Jump to content
Sign in to follow this  
Syfax

[HELP]Relog = Punishment

Recommended Posts

Hi! Please help me i need function for when relog inside Chaos argent players wont be able to join or enter the portal for 3 minutes
like relog punishment? and function for other maps too please? i tried search on search function but no relog punishment release. 
please help who have this 

Edited by Syfax

Share this post


Link to post
Share on other sites

You can make an array in varible.lua

Chaos = {}

and add to it values when character join Chaos:

Chaos[character ID] = join time

 

In function check_can_enter_map (ctrl.lua) you can check character's last join time. if it equals to nil or larger than current time then character can pass portal


Share this post


Link to post
Share on other sites

Put inside variable.lua:

ChaosArgentRelog = {}

 

Go to CTRL.lua for chaos argent which is: garner2 and find this:

function before_leave_garner2( role )

 

Add inside this function:

if(Hp(role) > 0)then
	local name = GetChaDefaultName(role)
	local punishmentTime = 180 -- 3 mins
	ChaosArgentRelog[name] = os.time() + punishmentTime
end

 

Inside entry.lua at function (check_can_enter_garner2) add this before 'return 1':

local name = GetChaDefaultName(role)
if(ChaosArgentRelog[name] ~= nil)then
	local relogRemainTime = ChaosArgentRelog[name] - os.time()
	if(relogRemainTime > 0)then
		BickerNotice(role,'You relogged inside Chaos Argent! You will be able to enter again in next ('..relogRemainTime..' secs)..')
		return 0
	end
end


-- Here it should be inside function normally, Remember it must be before return 1! ^
return 1

 

It should work perfectly, good luck =D

Edited by Sultan
  • Like 3

Share this post


Link to post
Share on other sites
43 minutes ago, 7n6 said:

@Jones when a player kills a player, set the dead players entry time to nill.

i dont see that in the script above, do I have to add it in if i wanted to implement this?

Share this post


Link to post
Share on other sites
1 hour ago, 7n6 said:

@Jones when a player kills a player, set the dead players entry time to nill.

I dont think that will work. because player_kill_player happens before

 

9 hours ago, Sultan said:

 


function before_leave_garner2( role )

 

Add inside this function:


local name = GetChaDefaultName(role)
local punishmentTime = 180 -- 3 mins
ChaosArgentRelog[name] = os.time() + punishmentTime

 

 

I would suggest in before_leave_garner2 that you check if Hp(role) is greater than 0.

 

1 hour ago, Jones said:

@Sultan can you tell me what makes it able to distingush between a player dead leaving and a person relogging? Thanks

As explained above, you can check their HP. If they are dead already, then it should not be considered a relog.
Another point to make, I think you can implement a better relog-punishment by using ChaHasTarget or something like it.
Because...
If you have full HP or half HP, but decide to relog for buffs, you get the punishment (which is bad, because you werent relogging from getting killed)
but
If you have full HP or half HP, decide to relog and no one has you as a target, you wont get a punishment (which is good).

  • Like 1

kong.png

a2.png

Share this post


Link to post
Share on other sites
7 minutes ago, xtc said:

I dont think that will work. because player_kill_player happens before

 

I would suggest in before_leave_garner2 that you check if Hp(role) is greater than 0.

 

As explained above, you can check their HP. If they are dead already, then it should not be considered a relog.
Another point to make, I think you can implement a better relog-punishment by using ChaHasTarget or something like it.
Because...
If you have full HP or half HP, but decide to relog for buffs, you get the punishment (which is bad, because you werent relogging from getting killed)
but
If you have full HP or half HP, decide to relog and no one has you as a target, you wont get a punishment (which is good).

 

Yes my bad.. I forgot to add it

Share this post


Link to post
Share on other sites

IMO re-logging is re-logging it doesn't matter if u are going for buffs... Well am talking for a server with real PK with Clerics on  the pk map otherwise u got a point xP.


Signature.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.

Sign in to follow this  

×
×
  • Create New...