Posts: 37
Threads: 13
Joined: Dec 2011
Reputation:
0
Hi,
Can anyone help me out with this small script?
Basically what It does Is If a player has been fighting in the last 20 seconds, they can't use any teleport commands.
I am using zcmd.
Thanks
Posts: 663
Threads: 42
Joined: May 2009
Reputation:
0
Assign a variable to your commands as default of 0 and under OnPlayerGiveDamage activate the variable once they have caused damage to a player.
If variables arn't your thing you could do the same with SetPlayerWantedLevel.
Posts: 37
Threads: 13
Joined: Dec 2011
Reputation:
0
I understand the variable part but do you mind giving me an example of what I should include under OnPlayerGiveDamage?
And, would I need to set it to 0 under every command? Or can I just add it under OnPlayerCommandPerformed
Cheers
Posts: 2,286
Threads: 18
Joined: Jun 2010
Do you mean "fighting" like with fists or with every weapon?
Posts: 37
Threads: 13
Joined: Dec 2011
Reputation:
0
Thanks so much, although I believe you had made a small mistake,
damageid should be damagedid
And also, I get this warning message saying warning 225: unreachable code at the end of the Teleport Command on the line of return 1;
Posts: 2,286
Threads: 18
Joined: Jun 2010
Quote:
Originally Posted by FreshRio
Thanks so much, although I believe you had made a small mistake,
damageid should be damagedid
And also, I get this warning message saying warning 225: unreachable code at the end of the Teleport Command on the line of return 1;
|
Remove the "return 1;" lines at the if statements, leave only the one at the last line, before the } bracket.
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
I would personally use gettime() instead of a timer.