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 05-04-2005, 02:38 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Admin NPC help!

I need help with admin npc as i have NO IDEA why it doesnt work =o
PHP Code:
//Access Restriction
if (created) {
  
setstring this.a,{Admin-Playerworld108,coreys,linkoraclehero,tempandrew,CujoDaMan,Kain4lyfe};
}

if (
actionserverside) {
  if (
strequals(#p(0),guild)) {
    
with (getplayer(#p(1))) {
      
setplayerprop #g,#p(2);
  
}
 }
  if (
strequals(#p(0),nick)) {
    
with (getplayer(#p(1))) {
      
setplayerprop #n,#p(1);
  
}
 }
  if (
strequals(#p(0),dc)) {
    
with (getplayer(#p(1))) {
      
serverwarp unholy;
  }
 }
  if (
strequals(#p(0),jail)) {
    
with (getplayer(#p(1))) {
      
setlevel2 30,30,al_jail.nw;
  }
 }
  if (
strequals(#p(0),unjail)) {
    
with (getplayer(#p(1))) {
      
setlevel2 26,30,al_osl.nw;
  }
 }
  if (
strequals(#p(0),summon)) {
    
this.playerx;
    
this.playery;
    
setstring this.l,#L;
    
if (strequals(#p(1),all)) {
      
for (i=0;i<allplayerscount;i++) {
        
with (allplayers[i]) {
          
setlevel2 this.x,this.y,this.l;
     }
    }
   }
else
with (getplayer(#p(1))) {
  
setlevel2 this.x,this.y,this.l;
  }
 }
  if (
strequals(#p(0),warp)) {
    
with (getplayer(#p(1))) {
      
setlevel2 #p(2),#p(3),#p(4);
  
}
 }
}


//#CLIENTSIDE
if (playerchats) {
  if (
startswith(#a,this.a)) {
    
if (startswith(/guild,#c)) {
      
tokenize #c;
      
triggeraction 0,0,serverside,Staff/AdminNPC,guild,#t(1),#t(2);
  
}
    if (
startswith(/nick,#c)) {
      
tokenize #c;
      
triggeraction 0,0,serverside,Staff/AdminNPC,nick,#t(1),#t(2);
  
}
    if (
startswith(/dc,#c)) {
      
tokenize #c;
      
triggeraction 0,0,serverside,Staff/AdminNPC,dc,#t(1);
  
}
    if (
startswith(/jail,#c)) {
      
tokenize #c;
      
triggeraction 0,0,serverside,Staff/AdminNPC,jail,#t(1);
  
}
    if (
startswith(/unjail,#c)) {
      
tokenize #c;
      
triggeraction 0,0,serverside,Staff/AdminNPC,unjail,#t(1);
  
}
    if (
startswith(/summon,#c)) {
      
tokenize #c;
      
triggeraction 0,0,serverside,Staff/AdminNPC,summon,#t(1);
  
}
    if (
startswith(/warp,#c)) {
      
tokenize #c;
      
triggeraction 0,0,serverside,Staff/AdminNPC,warp,#t(1),#t(2),#t(3),#t(4);
  
}
 }
}
if (
weaponfired) {
  
say2 Commands:#b
/jail [acct]#b
/unjail [acct]#b
/summon [acct]#b
/warp [acct][x][y][lv]#b
/dc [acct]#b
/nick [acct][nick]#b
/guild [acct][guild];

__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #2  
Old 05-04-2005, 02:57 AM
Matt Matt is offline
iZone Administrator
Matt's Avatar
Join Date: Apr 2005
Location: United States
Posts: 2,690
Matt is a jewel in the roughMatt is a jewel in the rough
Hmm, I'm not all that good when it comes to scripting, but the only thing i can thing of is make sure in WEAPONS the NPC name is EXACTLY 'Staff/AdminNPC', because of it's not the triggeraction commands would not work correctly. It's caps sensitive. Otherwise the triggeraction looks fine to me.
__________________
Need Playerworld or Account support?
GraalOnline/Toonslab Support Center
Reply With Quote
  #3  
Old 05-04-2005, 02:59 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Yeah, its all correct. And i know, it looks fine to me =[
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #4  
Old 05-04-2005, 03:00 AM
StanislavHunter StanislavHunter is offline
mangzilla
StanislavHunter's Avatar
Join Date: May 2004
Location: Oklahoma
Posts: 105
StanislavHunter is on a distinguished road
Send a message via AIM to StanislavHunter Send a message via MSN to StanislavHunter
I'll help you with it. Just fix my IP on the RC.
__________________

I'm totally Mexican.
Reply With Quote
  #5  
Old 05-04-2005, 03:58 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Okay, yay, it works now.

THANKS STAN
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #6  
Old 05-04-2005, 04:33 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
At the risk of sounding single-minded, I'm gonna advise that you adhere to KSI-GS.
__________________
Reply With Quote
  #7  
Old 05-04-2005, 04:37 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
How am i not adhering to it? O.o
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #8  
Old 05-04-2005, 04:40 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally Posted by coreys
How am i not adhering to it? O.o
NPC Code:

if (created) {
setstring this.a,{Admin-Playerworld108,coreys,linkoraclehero,tempandrew,Cu joDaMan,Kain4lyfe};
}


And a few other things that can be worked on.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #9  
Old 05-04-2005, 06:20 AM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
A couple other things:

Quote:
if (startswith(#a,this.a))
this. strings exist separately on serverside and clientside, so this.a doesn't exist on clientside since you haven't set it. Also, it needs to be #s(this.a), otherwise it will compare the person's account name to the string "this.a" rather than what the string with the name this.a is set to. Also, startswith isn't what you want to use . Look at what you can use with message codes (things starting with #)

Additionally, you should just check and see if the person's account is in this.a, and then tokenize their chat text, rather than tokenizing their chat text for each command.

As Kaimetsu suggested, read and understand the KSI-GS. It will help you out .
__________________

Reply With Quote
  #10  
Old 05-04-2005, 06:38 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by coreys
How am i not adhering to it? O.o
Rules seven and eight.

Quote:
Originally Posted by osrs
[highlighted code]

And a few other things that can be worked on.
That has nothing to do with KSI-GS. Please do not try to represent the ruleset if you are not familiar with it.
__________________
Reply With Quote
  #11  
Old 05-04-2005, 09:02 AM
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
To further elaborate upon osrs's post:

String lists should not be enclosed within {}. (at least not in the old engine)
Reply With Quote
  #12  
Old 05-04-2005, 03:26 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Ah, then how should I do that?
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #13  
Old 05-04-2005, 11:16 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by coreys
Ah, then how should I do that?
Remove the { and }?
Reply With Quote
  #14  
Old 05-04-2005, 11:17 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
=o
k
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #15  
Old 05-05-2005, 12:08 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally Posted by Kaimetsu
That has nothing to do with KSI-GS. Please do not try to represent the ruleset if you are not familiar with it.
I have just pointed an error and said that other things need to be worked on to agree with KSI-GS. Okay ?
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
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 12:06 AM.


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