![]() |
Scripting...ARG!
okay, i'm working on a script for a GP tool, to jail, disconnect etc.
The script i did only makes them say the reason they were jailed, etc. How would i fix this? Here's the code, srry for format X_x: if(actionserverside){ if(strequals(#p(0),summon)){with(getplayer(#p(2))) {setlevel2 #p(3),strtofloat(#p(4)),strtofloat(#p(5));savelog2 StaffToollog.txt,Staff="#p(1)" Summoned Player="#p(2)" To Level="#p(3);}} if(strequals(#p(0),jail1)){with (getplayer(#p(2))){setlevel2 jail1_darkrival2.nw,30,40;setplayerprop #c,Jailed For #p(3);savelog2 StaffToollog.txt,Staff="#p(1)" Jailed Player="#p(2)" To Reason="#p(3);}} if(strequals(#p(0),jail)){with (getplayer(#p(2))){setlevel2 jail_darkrival2.nw,28,38;setplayerprop #c,Jailed For #p(3);savelog2 StaffToollog.txt,Staff="#p(1)" Jailed Player="#p(2)" To Reason="#p(3);}} if(strequals(#p(0),disconnect)){with(getplayer(#p( 2))){disconnect;savelog2 StaffToollog.txt,Staff="#p(1)" Disconnected Player="#p(2)" Reason="#p(3);}}} //#CLIENTSIDE if(isweapon){ if(playerchats){tokenize #c; if(strequals(#t(0),/summon)){triggeraction 0,0,serverside,GP Control,summon,#a,#t(1),#L,#v(playerx ),#v(playery);} if(strequals(#t(0),/jail)){triggeraction 0,0,serverside,GP Control,jail,#a,#t(1),#t(2);} if(strequals(#t(0),/jail1)){triggeraction 0,0,serverside,GP Control,jail,#a,#t(1),#t(2);} if(strequals(#t(0),/disconnect)){triggeraction 0,0,serverside,GP Control,disconnect,#a,#t(1);} if(weaponfired){say2 Commands for GP's#b If there are "" in the command#b put them in#b /jail1 "account" "reason"#b -for minor offences, like swearing#b /jail "account" "reason"#b -anything from harassment to hacking#b /disconnect "account" "reason"#b -Use as a warning#b /maxjail "account" "reason"#b -SEVERE OFFENCES ONLY!#b You may also use your#b RC for manay of these#b commands. }} |
NPC Code: Several points : - 'if (weaponfired)' and 'if (playerchats)' should not appear inside another code block (ie: not inside the 'if (isweapon) {}' block). - Your missing a brace (One of these - '}') somewhere. (Or I accidentally deleted it when formatting the script.) - Format your code and use the code tag on these forums or you will probably get slapped round the head with a trout. If you'd formatted your code you will have spotted the missing brace probably. - You have some incorrect "quoting" of strings in the serverside part. |
i know the only thing is the disconnect that doesn't work now
|
Read the KSI-GS thread linked from the advice thread at the top of this forum, your code's structure needs improvement and it will explain to you how to fix it.
On another note, why does it seem like nobody knows how to use 'else if' anymore? |
There is no disconnect command to my knowledge.
|
Quote:
|
Quote:
|
You could also use some script to crash the players client, but I do not recommend this method. USed to, you could disconnect players by adding weapons or baddies clientside, but this has been disabled. Use serverwarp instead.
NPC Code:serverwarp internalname; for example: NPC Code:serverwarp playerworld107; |
Disconnecting is done through the control NPC. Don't ask how it's done, because I really haven't studied it. :[
|
Quote:
|
yeah i think i'm just gonna remove the disconnect, they can just use their RCs for that X_x
|
| All times are GMT +2. The time now is 05:19 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.