Graal Forums

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

coreys 05-04-2005 02:38 AM

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];



Matt 05-04-2005 02:57 AM

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.

coreys 05-04-2005 02:59 AM

Yeah, its all correct. And i know, it looks fine to me =[

StanislavHunter 05-04-2005 03:00 AM

I'll help you with it. Just fix my IP on the RC. ;)

coreys 05-04-2005 03:58 AM

Okay, yay, it works now.

THANKS STAN

Kaimetsu 05-04-2005 04:33 AM

At the risk of sounding single-minded, I'm gonna advise that you adhere to KSI-GS.

coreys 05-04-2005 04:37 AM

How am i not adhering to it? O.o

osrs 05-04-2005 04:40 AM

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.

CheeToS2 05-04-2005 06:20 AM

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

Kaimetsu 05-04-2005 06:38 AM

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.

Lance 05-04-2005 09:02 AM

To further elaborate upon osrs's post:

String lists should not be enclosed within {}. (at least not in the old engine)

coreys 05-04-2005 03:26 PM

Ah, then how should I do that?

Skyld 05-04-2005 11:16 PM

Quote:

Originally Posted by coreys
Ah, then how should I do that?

Remove the { and }?

coreys 05-04-2005 11:17 PM

=o
k

osrs 05-05-2005 12:08 AM

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 ? :whatever:

Evil_Trunks 05-05-2005 12:12 AM

NPC Code:
  if (startswith(#a,this.a)) {


you are checking this on the clientside when the this.a variable is only defined on the serverside part

the whole check is wrong in general as well, strings need to use #s(this.stringname), and the type of check you are doing there (startswith) is also completely wrong

osrs 05-05-2005 12:13 AM

Quote:

Originally Posted by Evil_Trunks
NPC Code:
  if (startswith(#a,this.a)) {


you are checking this on the clientside when the this.a variable is only defined on the serverside part

the whole check is wrong in general as well, strings need to use #s(this.stringname), and the type of check you are doing there (startswith) is also completely wrong

Yea, that is what CheeTos said.

Kaimetsu 05-05-2005 12:44 AM

Quote:

Originally Posted by osrs
I have just pointed an error and said that other things need to be worked on to agree with KSI-GS. Okay ?

He asked how he was violating KSI-GS and, after quoting his question, you highlighted a mistake in his script. Clearly you were citing it as a violation. Your pathetic attempt at a defense is only compounding your established ignorance with a childish refusal to accept your mistakes.

osrs 05-05-2005 04:06 AM

Quote:

Originally Posted by Kaimetsu
He asked how he was violating KSI-GS and, after quoting his question, you highlighted a mistake in his script. Clearly you were citing it as a violation. Your pathetic attempt at a defense is only compounding your established ignorance with a childish refusal to accept your mistakes.

Don't be hypocrite, you know what I meant. Maybe you should correct your mistake of feel the right to argue with everything.

Kaimetsu 05-05-2005 04:28 AM

Quote:

Originally Posted by osrs
Don't be hypocrite, you know what I meant

Ah, back to the "I'M RIGHT AND YOU KNOW I AM" defense. Dude, this one is pretty clear cut. Your intention in posting was to answer his question, else you wouldn't have quoted him. You were attempting to highlight a violation of KSI-GS despite not even understanding the rules yourself.

Quote:

Maybe you should correct your mistake of feel the right to argue with everything
I argue with everything now? Like, chairs and stuff? It is an interesting theory, but I think you would have trouble supporting it!

I don't even argue about everything. I was certainly justified in posting here to correct your misrepresentation of my ruleset. You are the one that turned it into an argument when you let your hatred of me prevent you from doing the proper thing and accepting your error.

osrs 05-05-2005 05:03 AM

Quote:

Originally Posted by Kaimetsu
Ah, back to the "I'M RIGHT AND YOU KNOW I AM" defense. Dude, this one is pretty clear cut. Your intention in posting was to answer his question, else you wouldn't have quoted him. You were attempting to highlight a violation of KSI-GS despite not even understanding the rules yourself.

I highlighted a violation and told him to work on other stuffs according to your rules, is it hard to get it ?

Quote:

Originally Posted by Kaimetsu
I argue with everything now? Like, chairs and stuff? It is an interesting theory, but I think you would have trouble supporting it!

I don't even argue about everything. I was certainly justified in posting here to correct your misrepresentation of my ruleset. You are the one that turned it into an argument when you let your hatred of me prevent you from doing the proper thing and accepting your error.

I accept my errors, when I know that I am wrong. You failed to understand what I posted, just it; and if you feel better, ok, you are always right Kaimetsu.

Kaimetsu 05-05-2005 05:19 AM

Quote:

Originally Posted by osrs
I highlighted a violation

Except that you didn't. That's what I've been trying to explain to you. The thing you highlighted does not constitute a violation of KSI-GS.

How many times do I need to say it?

Velox Cruentus 05-05-2005 01:05 PM

Kaimetsu -- He had confirmed already it wasn't KSI-GS.

I don't see where the argument's going to end, or why either side even contributes to it. In either case, osrs displayed an obvious error, and you displayed his error in the misconception of what he tried displaying it as. I don't see the creator of the thread arguing to either of you because he showed an error, but osrs seems pretty easily offended when his error is displayed, whereas he displayed someone elses.

*sigh* Good day.

coreys 05-05-2005 03:29 PM

Yeah, Kai, try to say what you want to say a little less like it's supposed to be an insult.
Quote:

Originally Posted by Kaimetsu
Your pathetic attempt at a defense is only compounding your established ignorance with a childish refusal to accept your mistakes.


osrs 05-05-2005 04:52 PM

Quote:

Originally Posted by Kaimetsu
Except that you didn't. That's what I've been trying to explain to you. The thing you highlighted does not constitute a violation of KSI-GS.

How many times do I need to say it?

I highlighted a coding violation, not a KSI-GS violation. Where did I say it was a KSI-GS violation ? I think you got the skill to read, right ? So don't judge for an error that never happened, if was I wrong, I would accept it and be quiet.

Quote:

Originally Posted by Velox Cruentus
but osrs seems pretty easily offended when his error is displayed, whereas he displayed someone elses.

I don't see any error here, I cited a coding mistake and told the guy to work more on code to agree with KSI-GS; If that was wrong, I will be quiet then.

Lance 05-05-2005 10:05 PM

Quote:

Originally Posted by osrs
I highlighted a coding violation, not a KSI-GS violation. Where did I say it was a KSI-GS violation ? I think you got the skill to read, right ? So don't judge for an error that never happened, if was I wrong, I would accept it and be quiet.

I don't see any error here, I cited a coding mistake and told the guy to work more on code to agree with KSI-GS; If that was wrong, I will be quiet then.

What the heck is a "coding violation"?

Kaimetsu 05-05-2005 10:43 PM

Quote:

Originally Posted by osrs
I highlighted a coding violation, not a KSI-GS violation. Where did I say it was a KSI-GS violation ?

...

Me: "I'm gonna advise that you adhere to KSI-GS"
Other Guy: "How am i not adhering to it? O.o"
You: "[quotes above post and highlights bad script]"

This is incredibly simple, dude. He asked how he was violating the ruleset. You quoted the question and replied. Were you attempting to answer his question? If so, you misrepresented KSI-GS. If not, why did you quote it?

And as Lance points out, the term "coding violation" is meaningless. It astounds me that you can be so self-assured in matters such as this when you have such a poor grasp of English.

coreys 05-06-2005 01:57 AM

X.X
Will you guys stop arguing, really?
Do it somewhere else =/

osrs 05-06-2005 02:17 AM

Quote:

Originally Posted by Lance
What the heck is a "coding violation"?

I meant a "code error", to be exact.

Quote:

Originally Posted by Kaimetsu
And as Lance points out, the term "coding violation" is meaningless. It astounds me that you can be so self-assured in matters such as this when you have such a poor grasp of English.

I am aware of my bad english dude, but hey, it is not my first language, so I at least try to do my best and even help who can speak english perfectly.

Kaimetsu 05-06-2005 04:34 AM

Quote:

Originally Posted by osrs
I am aware of my bad english dude, but hey, it is not my first language, so I at least try to do my best

Yes. My problem is not that your English is imperfect, but that you do not seem to consider the fact when arguing over matters of communication.

Luigi203 05-06-2005 05:20 AM

Why are you all arguing? The guy asked why his script didn't work, and amazingly someone found it in thier heart to answer the ORIGINAL QUESTION. The conversation should have ended there. If the guy initially gave a damn about all these KSI-GS infringements and 'coding standards/errors' he would have asked about them. You act like KSI-GS is a bible, and those who don't 'adhere' to it have committed a sin. This is rediulous how you people strech out the 'reply' of a simple inquiry into 2 pages, packed full of donkey sh*t. Make a new thread to show your true (*****ic) colors.

Kaimetsu 05-06-2005 06:11 AM

Quote:

Originally Posted by Luigi203
Why are you all arguing?

osrs made an error, I pointed it out. osrs started arguing about it.

Quote:

If the guy initially gave a damn about all these KSI-GS infringements and 'coding standards/errors' he would have asked about them
He did.


All times are GMT +2. The time now is 05:26 AM.

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