Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-02-2002, 04:44 AM
aesquivel aesquivel is offline
Registered User
Join Date: Sep 2001
Location: Whitewright
Posts: 346
aesquivel is on a distinguished road
Send a message via AIM to aesquivel
Access list

I need some help with an npc that lets me set who can have access to a room. like i cna do add "aesquivel" and it will let the account aesquievl in if you can help me im me on aim : Hax0r8669

thanx
__________________
  #2  
Old 06-02-2002, 05:39 AM
BBflat BBflat is offline
Registered User
BBflat's Avatar
Join Date: Apr 2002
Location: United States of America
Posts: 573
BBflat is on a distinguished road
Re: Access list

Quote:
Originally posted by aesquivel
I need some help with an npc that lets me set who can have access to a room. like i cna do add "aesquivel" and it will let the account aesquievl in if you can help me im me on aim : Hax0r8669

thanx
Okay, when a player enters, tokenize all the accounts, then go through a for loop, seeing if the player's account is equal to any of the tokens. If the account matches one, set a variable. If the variable has not changed at the end, warp the player out.
  #3  
Old 06-02-2002, 05:43 AM
aesquivel aesquivel is offline
Registered User
Join Date: Sep 2001
Location: Whitewright
Posts: 346
aesquivel is on a distinguished road
Send a message via AIM to aesquivel
Re: Re: Access list

Quote:
Originally posted by BBflat

Okay, when a player enters, tokenize all the accounts, then go through a for loop, seeing if the player's account is equal to any of the tokens. If the account matches one, set a variable. If the variable has not changed at the end, warp the player out.
so...


NPC Code:

if (playerenters) {
tokenize #a;
}
for (#a) {
}



okay im stuck now... help plz??
__________________
  #4  
Old 06-02-2002, 05:58 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
thanks to the new string arrays. tokinization is not neccisary.. just do

if(lindex(#a,list) != -1)

-1 being the value it returns if your account isn't in the array.
__________________

subliminal message: 1+1=3
  #5  
Old 06-02-2002, 06:01 AM
aesquivel aesquivel is offline
Registered User
Join Date: Sep 2001
Location: Whitewright
Posts: 346
aesquivel is on a distinguished road
Send a message via AIM to aesquivel
how do i add ppl to the list??
__________________
  #6  
Old 06-02-2002, 06:09 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
setstring this.stringname,account1,account2,account3,ect;
the list is the string name, in this case this.stringname
  #7  
Old 06-02-2002, 06:13 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
if your list is "this.stringname" then you would substitute "list" with "this.stringname"
be careful when using string array. lists don't need #s() but strings do.
__________________

subliminal message: 1+1=3
  #8  
Old 06-02-2002, 06:14 AM
aesquivel aesquivel is offline
Registered User
Join Date: Sep 2001
Location: Whitewright
Posts: 346
aesquivel is on a distinguished road
Send a message via AIM to aesquivel
okay now im kinda even more confused well sorta

NPC Code:

if (playerenters) {
if(lindex(#a,list) != -1) {
setlevel2 onlinestartlocal.graal,30,30;
}
}
if (playerchats) {
if (startswith(Add,??) {
setstring this.stringname,account1,account2,account3,ect;
}
}


coudl some one help me out with what i have so far?
__________________
  #9  
Old 06-02-2002, 06:35 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
its not lindex, its lindexof( str, list)...

__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
  #10  
Old 06-02-2002, 06:55 AM
aesquivel aesquivel is offline
Registered User
Join Date: Sep 2001
Location: Whitewright
Posts: 346
aesquivel is on a distinguished road
Send a message via AIM to aesquivel
Could some one fix this plz
NPC Code:

if (playerenters) {
if(lindexof(#a,list) != -1) {
setlevel2 onlinestartlocal.graal,30,30;
}
}
if (playerchats) {
if (startswith(Add,??) {
setstring this.stringname,account1,account2,account3,ect;
}
}

__________________
  #11  
Old 06-02-2002, 07:27 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
Quote:
Originally posted by aesquivel
Could some one fix this plz
NPC Code:

if (playerenters) {
if(lindexof(#a,list) != -1) {
setlevel2 onlinestartlocal.graal,30,30;
}
}
if (playerchats) {
if (startswith(Add,??) {
setstring this.stringname,account1,account2,account3,ect;
}
}

I will not hand you the solution on a silver platter but here is your problems:

1.
NPC Code:

if(lindexof(#a,list) != -1) {



and list is your list? I think not. You need to specify your list as this.stringname
please don't take things THIS literally. Copy-paste doesn't work when we are just explaining the commands, not giving you a script. Our examples are suppliments to the informations in commands.rtf. Please get scripting background before asking advanced questions.

2.
NPC Code:

if (startswith(Add,??) {



Hate to break it to you but "??" will never start with "Add", not even if you think happy thoughts and get pixie dust.

3.
NPC Code:

setstring this.stringname,account1,account2,account3,ect;



again, copy paste isn't what we want you to do. Figure out the commands. we are litterally saying

setstring THE_STRING_NAME_YOU_WANT_PLEASE_PUT_HERE,ACCOUNT #1,ETC.

you must interperate that as "Oh. maybe i should substitute this literal things with acual code... so
setstring this.accounts,aesquivel,Falcor,Stefan,Man_from_mar s;
or whatever the accounts you want to be in the string.
__________________

subliminal message: 1+1=3
  #12  
Old 06-02-2002, 07:37 AM
aesquivel aesquivel is offline
Registered User
Join Date: Sep 2001
Location: Whitewright
Posts: 346
aesquivel is on a distinguished road
Send a message via AIM to aesquivel
i know that i was jus puting it there so that i could figure out the problem that i had... and the ?? was for i have no freakin clue what goes next!
__________________
Closed Thread


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:59 PM.


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