View Single Post
Grytolle Grytolle's Avatar

JCF Member

Joined: Sep 2004

Posts: 4,126

Grytolle is a forum legendGrytolle is a forum legendGrytolle is a forum legend

Feb 3, 2013, 09:44 AM
Grytolle is offline
Reply With Quote
Quote:
Originally Posted by Just a Random User View Post
Punishment should be -1h. Killing a player sounds too severe. If I use this script, will this work for -1h punishment?

Code:
if (isCamping[1]) 
{
     jjChat("I camped for too long " + campAreaName[i] + ". Now I get punishment");
     p.health = p.health - 1;
     campTime[i] = 0;
}
Yes, that would work, but you might be able to write it shorter like this:
Code:
p.health -= 1;
I've made a new version of the script, however. In this version, you'd need to use this:
Code:
jjPlayers[pID].pHealth -= 1;
//or
jjPlayers[pID].pHealth = jjPlayers[pID].pHealth - 1;
----------

Please use pastebin to see everything properly: http://pastebin.com/fwQ1Q3b9
Code:
saving space
__________________
<center></center>

Last edited by Grytolle; Feb 3, 2013 at 01:59 PM. Reason: SE pointed out that relative expressions might not work well with objects