Syfax 2 Report post Posted August 3, 2016 Hello^^ it's been a long time.I have just obtained EGPKO Server Files ,there was a missing map there called Guild Vs Guild, i've recreated it and fixed a bug.Special thanks to @V1tor. But afterall it's still having a little bug, it doesn't reward the people that did stay in map. USING COD BY SULTAN PKODEV SCRIPTS Quote Share this post Link to post Share on other sites
Guest Report post Posted August 3, 2016 As I've tried to tell you: return all characters from the same guild by writing tables and reading them. after using a loop give a reward, that's how I see a solution to your problem. Quote Share this post Link to post Share on other sites
Angelix 374 Report post Posted August 3, 2016 You can do it like CA, when kicking out players, give them rewards. Check how "garner2" does it. 1 Quote Share this post Link to post Share on other sites
Syfax 2 Report post Posted August 3, 2016 32 minutes ago, Angelix said: You can do it like CA, when kicking out players, give them rewards. Check how "garner2" does it. Hello, I know that already, but it's a Guild Vs Guild which map scripts are having no relation to CA. 2 hours ago, Syfax said: Hello^^ it's been a long time.I have just obtained EGPKO Server Files ,there was a missing map there called Guild Vs Guild, i've recreated it and fixed a bug.Special thanks to @V1tor. But afterall it's still having a little bug, it doesn't reward the people that did stay in map. USING COD BY SULTAN PKODEV SCRIPTS Tryed this one , didnt work out. Quote Share this post Link to post Share on other sites
Sultan 68 Report post Posted August 3, 2016 (edited) @Syfax The most easiest way to reward winner guild is to use "DealAllActivePlayersInMap" from garner2 scripts as @V1tor said. Do some checking like "if" winner guild then add rewards. Also "again", more than one-hundred times.. do some research because this is so easy. So basically, the code basically going to be like Inside before_close: DealAllActivePlayersInMap(map_copy,'GuildRewards') Function inside ctrl.lua function GuildRewards(role) ---- some scripts if(guild == winner guild)then GiveItem(role,0,1,1,4) end end Edited August 7, 2016 by Sultan made a mistake Quote Share this post Link to post Share on other sites
Angelix 374 Report post Posted August 3, 2016 3 hours ago, Syfax said: Hello, I know that already, but it's a Guild Vs Guild which map scripts are having no relation to CA. No, they don't have any relation whatsoever, but you can copy the scripts and use them to give out rewards. @Sultan already explained a bit on what I mean. Quote Share this post Link to post Share on other sites
Syfax 2 Report post Posted August 4, 2016 11 hours ago, Sultan said: @Syfax The most easiest way to reward winner guild is to use "DealAllActivePlayersInMap" from garner2 scripts as @V1tor said. Do some checking like "if" winner guild then add rewards. Also "again", more than one-hundred times.. do some research because this is so easy. So basically, the code basically going to be like Inside before_leave: DealAllActivePlayersInMap(map_copy,'GuildRewards') Function inside ctrl.lua function GuildRewards(role) ---- some scripts if(guild == winner guild)then GiveItem(role,0,1,1,4) end end Uhm,This is by 3 Ranks. i guess Quote Share this post Link to post Share on other sites
Syfax 2 Report post Posted August 4, 2016 And guess what after adding these scripts , map isn't openning anymore LOL Quote Share this post Link to post Share on other sites
Guest Report post Posted August 4, 2016 1 hour ago, Syfax said: And guess what after adding these scripts , map isn't openning anymore LOL Show your scripts... Quote Share this post Link to post Share on other sites
Guest Report post Posted August 4, 2016 5 minutes ago, Syfax said: Lets go for facebook Post them here so that whoever encounters the same error would find a solution easily. https://s31.postimg.org/xakdihn6z/Capture.png <- @Syfax Quote Share this post Link to post Share on other sites
Syfax 2 Report post Posted August 4, 2016 https://mega.nz/#!OlEDibzb!o6ukUmL5_HNCzYG4DMaKoSduY3aRBaM49OJZOFu_LsM Quote Share this post Link to post Share on other sites
Guest Report post Posted August 4, 2016 Your map codes are so messy I suggest to clean them up. Also, you didn't do what Sultan told you (partly) as well as you didn't remove your old rewarding functions: local Item = {} -- list the items below Item[1] = 2792 -- Flash Bomb Lv5 Item[2] = 2794 -- Soul Detector Lv5 Item[3] = 1860 -- Blessed Potion Item[4] = 4028 -- BBQ Shark Fin Item[5] = 3909 -- Gyoza -- math.random items local a = math.random(1,5) local b = math.random(1,5) local c = math.random(1,5) -- Hand over 3 set of items of random amount GiveItem(role,0,Item[a],5,4) GiveItem(role,0,Item[b],3,4) GiveItem(role,0,Item[c],3,4) Quote Share this post Link to post Share on other sites
Syfax 2 Report post Posted August 4, 2016 43 minutes ago, V1tor said: Your map codes are so messy I suggest to clean them up. Also, you didn't do what Sultan told you (partly) as well as you didn't remove your old rewarding functions: local Item = {} -- list the items below Item[1] = 2792 -- Flash Bomb Lv5 Item[2] = 2794 -- Soul Detector Lv5 Item[3] = 1860 -- Blessed Potion Item[4] = 4028 -- BBQ Shark Fin Item[5] = 3909 -- Gyoza -- math.random items local a = math.random(1,5) local b = math.random(1,5) local c = math.random(1,5) -- Hand over 3 set of items of random amount GiveItem(role,0,Item[a],5,4) GiveItem(role,0,Item[b],3,4) GiveItem(role,0,Item[c],3,4) i added what sultan said o,o Quote Share this post Link to post Share on other sites
Sultan 68 Report post Posted August 7, 2016 (edited) @Syfax What I have mentioned above was a mistake. Instead of saying before_close I said before_leave. Anyways, in the first place there is no identifier show's "map_copy" inside before_leaves so it shouldn't be added there. This means every time player leaves the map they going to get rewards (I don't really know if you're using my deathcircle scripts or not, but they are messy and probably was under test/beta so I recommend using official ones and clean ones). Firstly, replace YOUR "before_leave" to this one: function before_leave_egpkogvg( player ) local characterName = GetGuildName(GetChaGuildID(player)) if (egpkogvg_flag_holder == characterName) then egpkogvg_flag_holder = nil RemoveState(player,egpkogvg_conf.flag_holder_state) end hp = Hp(player) if (hp > 0) then egpkogvg_players[characterName] = { score = 0, death = 0, kill = 0, holdflagtime = 0 } end egpkogvg_players[characterName].inside = false egpkogvg_playercount = egpkogvg_playercount - 1 end Secondly, You must add the "DealAllActivePlayersInMap" inside "before_close" DealAllActivePlayersInMap(map_copy,'GuildRewards') Finally, For me editing something for another is hard. I always do things from scratch and try take ideas/help/scripts from things such as "deathcircle", "garner", and TOP related .LUA files, etc. I am not sure what's missing, but I think is the rewarding section. Do what I have said above and make a "checker" as displayed in "if" statement. Check before_close you might need to do a lot of editing/testing to know how. Guild rewards function you must edit it fully, I only GAVE AN EXAMPLE: local guild_name = GetGuildName(GetChaGuildID(role)) if(guild_name == GUILDWINNER)then GiveItem(role,0,192,1,4) end P/S: "GUILDWINNER" should be a VARIABLE. To check if player's guild name is same as GUILDWINNER or not. You SHOULD put the winners at before_close by setting up the variable as: GUILDWINNER = '"HERE GUILD NAME" Go learn the "deathcircle" script on how to get the winner guild placed as variable. AND AGAIN .... DO SOME RESEARCH IN OTHER WORKING MAPS... EDITING SOMETHING WOULDN'T WORK SO EASILY Edited August 7, 2016 by Sultan 1 Quote Share this post Link to post Share on other sites