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 08-15-2005, 05:05 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Question 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.
}}
Reply With Quote
  #2  
Old 08-15-2005, 06:11 PM
Polo Polo is offline
Classic Systems Admin
Join Date: Sep 2002
Location: Vancouver, Canada
Posts: 735
Polo is on a distinguished road
Send a message via AIM to Polo
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.
__________________
Be good little players, or Master Storm will ban you!



Proof that the staff are crazy..
*Ghost Pirate: I'm a little teacup short and stubbe here is my raygun here is my butt
DragonX: Jumping jack rabbits Batman! Our eggo waffles have been stolen! To the batmobile Robin!
X-Mann (RC): I have a head ache
Reply With Quote
  #3  
Old 08-15-2005, 06:12 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
i know the only thing is the disconnect that doesn't work now
Reply With Quote
  #4  
Old 08-15-2005, 07:08 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
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?
Reply With Quote
  #5  
Old 08-15-2005, 07:34 PM
Maniaman Maniaman is offline
Registered User
Join Date: Aug 2005
Posts: 326
Maniaman is on a distinguished road
There is no disconnect command to my knowledge.
__________________

Current Maloria Event: (click to go to it)
Reply With Quote
  #6  
Old 08-15-2005, 08:07 PM
Polo Polo is offline
Classic Systems Admin
Join Date: Sep 2002
Location: Vancouver, Canada
Posts: 735
Polo is on a distinguished road
Send a message via AIM to Polo
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
__________________
Be good little players, or Master Storm will ban you!



Proof that the staff are crazy..
*Ghost Pirate: I'm a little teacup short and stubbe here is my raygun here is my butt
DragonX: Jumping jack rabbits Batman! Our eggo waffles have been stolen! To the batmobile Robin!
X-Mann (RC): I have a head ache
Reply With Quote
  #7  
Old 08-15-2005, 08:46 PM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
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.
Reply With Quote
  #8  
Old 08-15-2005, 08:59 PM
Maniaman Maniaman is offline
Registered User
Join Date: Aug 2005
Posts: 326
Maniaman is on a distinguished road
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;

__________________

Current Maloria Event: (click to go to it)
Reply With Quote
  #9  
Old 08-15-2005, 09:04 PM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
Disconnecting is done through the control NPC. Don't ask how it's done, because I really haven't studied it. :[
Reply With Quote
  #10  
Old 08-15-2005, 10:10 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
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.
Reply With Quote
  #11  
Old 08-16-2005, 01:13 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
yeah i think i'm just gonna remove the disconnect, they can just use their RCs for that X_x
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 01:14 AM.


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