View Single Post
  #2  
Old 10-22-2011, 03:39 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by Gunderak View Post
Hello, I am working on a jail system, Iv'e made the staff bit where you chose who, the reason, the hours, the minutes and the seconds it works as this.
PHP Code:
client.reason "whatever the staff member chooses";
client.hours "whatever the staff member chooses";
client.minutes "whatever the staff member chooses";
client.seconds "whatever the staff member chooses"
And now comes the daunting task of making the time decrease properly.
I am pretty much stuck on this bit, each way I attempt to have a crack at it, it just screws up/doesn't function properly.
This is all I have got so far but i am pretty sure if more than one person is jailed the server side this.whatevers will change and screw it all up.
PHP Code:
function onActionServerSide(){
if(
params[0] == "jailcheck"){
if(
client.hours || client.minutes || client.seconds 0){
client.jailed 1;
}else{
client.jailed 0;
}
this.hours params[1];
this.minutes params[2];
this.seconds params[3];
}
}
//#CLIENTSIDE
function onCreated(){
onTimeout();
}
function 
onTimeout(){
triggerserver("weapon"this.name"jailcheck"client.hoursclient.minutesclient.seconds);
settimer(1);

PS Its in a weapon added to all players.
Any suggestions are welcome
You really do not want to store jail variables as client. vars, as they can be modified through memory editors etc.

It would also be very inefficient to have a triggerserver every second for jailed players, it would be better to have a serverside NPC loop through all jailed players within a level each minute or so,
Reply With Quote