Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-22-2011, 03:32 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Jail Script Help

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
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #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
  #3  
Old 10-22-2011, 03:51 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Thats the problem..
I do not know how to do it as a DB NPC.
And I thought that memory editing disconnects you?
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #4  
Old 10-22-2011, 04:03 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
Thats the problem..
I do not know how to do it as a DB NPC.
And I thought that memory editing disconnects you?
You can write dynamic this.vars to a database by doing:

PHP Code:
this.("jail_" temp.plname "_jailer") = temp.jailer;
this.("jail_" temp.plname "_reason") = temp.reason
etc.

And while certain cheat programs are automatically detected some can avoid detection while other methods simply aren't detected. There's also the issue now that people are inserting false scripts into the client which could very easily modify these types of variables.
Reply With Quote
  #5  
Old 10-22-2011, 04:07 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Ah ok, I didnt even think of setting variables in the NPC, I was thinking of adding them to an array which I do not know how to do x-x
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #6  
Old 10-22-2011, 05:08 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
My advice: don't make a jail system. Bans are superior to jails in every way.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #7  
Old 10-22-2011, 05:25 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by xXziroXx View Post
My advice: don't make a jail system. Bans are superior to jails in every way.
You can't specify custom times on bans (i.e. less than 3 days). You also can't specify custom reasons on a ban to be displayed to the player.
__________________
Reply With Quote
  #8  
Old 10-22-2011, 05:26 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by cbk1994 View Post
You can't specify custom times on bans (i.e. less than 3 days). You also can't specify custom reasons on a ban to be displayed to the player.
I don't see the issue with that.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #9  
Old 10-22-2011, 05:31 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by xXziroXx View Post
I don't see the issue with that.
If you want to ban players for less than three days you can't, and if you ban for a "reason" not related to the actual reason, the player may not know why they're banned. You don't see those as issues?

You can't even ban via script—without a jail, how do you propose to contain players who have been caught by cheating detection systems?

I'm not arguing that jails are better than bans, I'm merely contesting your assertion that bans are superior in every way to jails. They clearly aren't.
__________________
Reply With Quote
  #10  
Old 10-22-2011, 06:00 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Can also "destroy" a server with bans, can't with a jailing system.
__________________
Quote:
Reply With Quote
  #11  
Old 10-22-2011, 06:10 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
Jailing rights may also be more appropriate over ban rights for new/trial police staff, it also gives jailed players the opportunity to PM staff RCs to dispute their punishment (ever been jailed after a bush NPC has repeatedly set your chat to "you are such a ****... bush!"?).
Jailing can also be handled automatically should someone be caught hacking via script, as can a scripted IP ban, but not a normal ban.
Reply With Quote
  #12  
Old 10-22-2011, 06:51 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by ffcmike View Post
Jailing rights may also be more appropriate over ban rights for new/trial police staff
"Police" staff is redundant in my eyes.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #13  
Old 10-22-2011, 09:41 PM
Cloven Cloven is offline
Delteria
Cloven's Avatar
Join Date: Dec 2006
Location: Florida, United States
Posts: 542
Cloven has a spectacular aura about
Send a message via AIM to Cloven
I don't see much purpose in "wait-"based jail systems because they're highly ineffective as a deterrent.
Reply With Quote
Reply


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 10:13 AM.


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