Jump to content
Sign in to follow this  
Syfax

Question Guild Vs Guild(having some bugs)

Recommended Posts

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

 

Share this post


Link to post
Share on other sites
Guest

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

@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 by Sultan
made a mistake

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Guest
1 hour ago, Syfax said:

And guess what after adding these scripts , map isn't openning anymore LOL

Show your scripts...

Share this post


Link to post
Share on other sites
Guest

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)

 

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

@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

 

SecondlyYou 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 by Sultan
  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...