Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:39 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.