Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Jail Script Help (https://forums.graalonline.com/forums/showthread.php?t=134264848)

Gunderak 10-22-2011 03:32 PM

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 :)

ffcmike 10-22-2011 03:39 PM

Quote:

Originally Posted by Gunderak (Post 1671459)
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,

Gunderak 10-22-2011 03:51 PM

Thats the problem..
I do not know how to do it as a DB NPC.
And I thought that memory editing disconnects you?

ffcmike 10-22-2011 04:03 PM

Quote:

Originally Posted by Gunderak (Post 1671462)
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.

Gunderak 10-22-2011 04:07 PM

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

xXziroXx 10-22-2011 05:08 PM

My advice: don't make a jail system. Bans are superior to jails in every way.

cbk1994 10-22-2011 05:25 PM

Quote:

Originally Posted by xXziroXx (Post 1671470)
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.

xXziroXx 10-22-2011 05:26 PM

Quote:

Originally Posted by cbk1994 (Post 1671471)
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.

cbk1994 10-22-2011 05:31 PM

Quote:

Originally Posted by xXziroXx (Post 1671472)
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.

fowlplay4 10-22-2011 06:00 PM

Can also "destroy" a server with bans, can't with a jailing system.

ffcmike 10-22-2011 06:10 PM

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.

xXziroXx 10-22-2011 06:51 PM

Quote:

Originally Posted by ffcmike (Post 1671477)
Jailing rights may also be more appropriate over ban rights for new/trial police staff

"Police" staff is redundant in my eyes. :p

Cloven 10-22-2011 09:41 PM

I don't see much purpose in "wait-"based jail systems because they're highly ineffective as a deterrent.


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

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