Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Scripting...ARG! (https://forums.graalonline.com/forums/showthread.php?t=60526)

excaliber7388 08-15-2005 05:05 PM

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.
}}

Polo 08-15-2005 06:11 PM

NPC Code:

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.
}
}



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.

excaliber7388 08-15-2005 06:12 PM

i know the only thing is the disconnect that doesn't work now

Lance 08-15-2005 07:08 PM

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?

Maniaman 08-15-2005 07:34 PM

There is no disconnect command to my knowledge.

Polo 08-15-2005 08:07 PM

Quote:

Originally Posted by Lance
On another note, why does it seem like nobody knows how to use 'else if' anymore?

Some of us still know the ways ;)

protagonist 08-15-2005 08:46 PM

Quote:

Originally Posted by Maniaman
There is no disconnect command to my knowledge.

I was going to say that. I would just send the player to kingdoms or something like that.

Maniaman 08-15-2005 08:59 PM

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;


Bl0nkt 08-15-2005 09:04 PM

Disconnecting is done through the control NPC. Don't ask how it's done, because I really haven't studied it. :[

Lance 08-15-2005 10:10 PM

Quote:

Originally Posted by Maniaman
You could also use some script to crash the players client, but I do not recommend this method.

With the whole "It results in a prompt global ban" thing and all.

excaliber7388 08-16-2005 01:13 AM

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.