Jump to content
Eviles

State for Guild Members

Recommended Posts

Hello guys. Currently i'm working on my first serialize project and seems all fine at the moment, but i got a mistake with setting "state" to all members in a guild. The point is load a table get a exact value of a table and then add a state, i did it but it didn't worked properly.. the glow keep blinking and bonus doesn't refresh.
 

function GuildBuff(ignore,role)
	local GuildID = GetChaGuildID(role)
	if(file_exists(Alliance.Path..""..GuildID..".txt") == true) then -- Check if database exists
	local Get			= table.load(Alliance.Path..""..GuildID..".txt","r") -- load database
	local Alliance_Lv 	= Get.Level -- get level on the table	
		if Alliance_Lv == 1 then
			local statelv = 1 
			local statetime = 3600
			AddState( role , role , STATE_GBUFF , statelv , statetime )
		else
			local state1 = GetChaStateLv(role, STATE_GBUFF)
			if state1 ~= 0 then
				RemoveState(role, STATE_GBUFF)
			end
		end			
	end
end
Hook:AddPostHook("custom_cha_timer",GuildBuff)

Isn't working fine because i used (role,role) to set the state for all members? What should i use?

Edited by Satan

lelouch_signature_by_vahntheknight-d4uafwj.png

Share this post


Link to post
Share on other sites
2 hours ago, InuYasha said:

but what about this custom_cha_timer? how to add this custom cha timer?

Feel fre to ask at question section like i did :) 


lelouch_signature_by_vahntheknight-d4uafwj.png

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.


×
×
  • Create New...