Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-13-2006, 11:56 PM
talkingnoodle talkingnoodle is offline
Rapidwolve
talkingnoodle's Avatar
Join Date: Nov 2005
Location: Leominster, MA
Posts: 229
talkingnoodle is on a distinguished road
Send a message via AIM to talkingnoodle Send a message via MSN to talkingnoodle
getnpc help

PHP Code:
function onActionServerside(){
if (
params[0] == "check"){
this.accept 0;
with (getnpc("Police-DB")){
if (
player.account in this.admins){
this.accept 1;
}
}

if (
this.accept == 1){
player.chat "Accepted";
}else{
player.chat "Rejected";
}

Doesnt work it always says rejected
__________________


AIM: Rapidwolve Graal
MSN: [email protected]


2/12/06 - Crossroads NPC Admin
Reply With Quote
  #2  
Old 02-13-2006, 11:59 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
The correct format is

NPC Code:
with (findnpc(npc))



I don't use quotes when using it, but I don't think it will bother anything if there are quotes there.
Reply With Quote
  #3  
Old 02-14-2006, 02:32 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Bl0nkt
I don't use quotes when using it, but I don't think it will bother anything if there are quotes there.
I don't use quotes either, but I think with the '-' you might need to.

Also:
PHP Code:
this.accept = (player.account in ("Police-DB").admins); 
would work too.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #4  
Old 02-14-2006, 12:28 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Change
NPC Code:
this.accept


in the with() statement to
NPC Code:
thiso.accept


You're trying to check a variable that does not exist, considering you just set it in the Police-DB npc.
__________________
Reply With Quote
  #5  
Old 02-14-2006, 03:27 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
also, you should probably be using findNPC("Police-DB")
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #6  
Old 04-16-2006, 05:38 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
^-- was mentioned above.

Do you use findnpc like findplayer?

temp = findnpc("Police-DB");
temp.test = "blah";

or something?

*Edit* Haha, I didn't know I revived a dead thread lol. I don't look @ dates ;O *Edit*
Reply With Quote
  #7  
Old 04-19-2006, 02:35 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by KuJi
Do you use findnpc like findplayer?

temp = findnpc("Police-DB");
temp.test = "blah";
temp is a predefined prefix, so I don't think you should be doing something like that.

temp.blah = findNPC("Police-DB");
temp.blah.test = "WEeEeeEe";

would set this.test inside the Police-DB NPC.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #8  
Old 04-19-2006, 05:02 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
You could also do

Police-DB.this.test = "Lal";
which would also set it.
Reply With Quote
  #9  
Old 04-19-2006, 05:18 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Quote:
Originally Posted by xAndrewx
You could also do

Police-DB.this.test = "Lal";
which would also set it.
The - in the name makes that unpossible.
Referencing is best.

n = findnpc("Police-DB);
if (n.admins.index(player.account) >= 0) {
this.accept = 1;
}
Reply With Quote
  #10  
Old 04-20-2006, 10:18 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Ah, I didn't that. Thanks
If anything, I use

with(findnpc())
{
Reply With Quote
  #11  
Old 04-20-2006, 11:29 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Ugh, for some reason, I can't get it to read data:
temp.test = findnpc("Blah");
player.chat = temp.test.test;
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 07:00 PM.


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