Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-01-2001, 04:15 AM
Guest
Posts: n/a
I need to know..

How would i remove a account name from server.jail
Like if their is server.jail= Joe james roe and i say Unjail Player Joe
it will remove their accountname out of server.jail=
thanks for helping...
Reply With Quote
  #2  
Old 10-01-2001, 04:18 AM
IceHawk IceHawk is offline
Jenseits von Gut und Böse
IceHawk's Avatar
Join Date: Mar 2001
Location: Vancouver BC, Canada
Posts: 4,704
IceHawk will become famous soon enough
Send a message via AIM to IceHawk
I can't understand that
__________________
Reply With Quote
  #3  
Old 10-01-2001, 04:30 AM
Vinvect Vinvect is offline
Registered User
Join Date: Aug 2001
Location: U.S.A,California,Milpitas,In A House,In Room,On A Seat,On a Computer
Posts: 157
Vinvect is on a distinguished road
Send a message via ICQ to Vinvect Send a message via Yahoo to Vinvect
he means how to do leik
if a person's account name is:
CoolDude
then u say this
unjail CoolDude
thats wut he means
__________________
==========================
I Script Really Good
&
Looking For A NAT Job
==========================
Quote:
That's like a big lugee!
-Evolution The Movie
Quote:
Ha Ha Ha Give It Up!
-Cyrus From Bomberman
I'm not a Bomy anymore.
I'm a MUTATED BROCLI MONSTER!
(or SIGN MONSTER)
If you make me angry,
I'LL EAT YOU WHOLE!
ME, MUTATED BROCLI MONSTER MASTER
(or SIGN MONSTER)
WILL EAT YOU ALL UP!
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Quest Valley Owner
Looking For Staff
Pm Me
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
O.o Still Have My Braen Damaegd o.O


Thanks To Esiah, He Made This For Me!
Thanks Esiah!
Reply With Quote
  #4  
Old 10-01-2001, 04:38 AM
Dean Dean is offline
Banned
Join Date: Sep 2001
Location: United Kingdom
Posts: 351
Dean will become famous soon enough
dunno

beats me?
Reply With Quote
  #5  
Old 10-01-2001, 05:04 AM
Guest
Posts: n/a
Whoever tells me the script, i will give like 20-25 gralts on graal.
Reply With Quote
  #6  
Old 10-01-2001, 05:11 AM
Metal-Slug Metal-Slug is offline
!_!
Metal-Slug's Avatar
Join Date: Jun 2001
Posts: 2,421
Metal-Slug is on a distinguished road
Quote:
Originally posted by Kaimetsu
IcePick, you should clear your PM box again. Even the sent items.
hey, kame, can you shrink yourself into a pocket size so i can use you? i need allot help about,, now
Reply With Quote
  #7  
Old 10-01-2001, 05:25 AM
Guest
Posts: n/a
Quote:
Originally posted by Kaimetsu
IcePick, you should clear your PM box again. Even the sent items.
Okay i did, But can you help me with this script? I really really need it bad!
Reply With Quote
  #8  
Old 10-01-2001, 05:41 AM
Guest
Posts: n/a
Quote:
Originally posted by Kaimetsu


Ack. I'll point you in the right direction:

Use indexof to find where the name to be removed is in the list. Then use #e to isolate the chunk in front of it and the chunk behind it and do:

setstring server.jail,#e(informationforstuffinfront) #e(informationforstuffbehind);

I'll help more if you get stuck, but if you do request more help then post what commands.rtf says about #e and indexof at the same time because I've forgotten the syntaxes and I ca't be bothered going to my Graal folder.
Ok I am stuck, I will talk to you in pm, so read your pm...
Reply With Quote
  #9  
Old 10-01-2001, 05:53 AM
Guest
Posts: n/a
Message board pm that is, not on graal.
Reply With Quote
  #10  
Old 10-01-2001, 05:56 AM
Guest
Posts: n/a
#e(startindex,length,string) extracts a substring out of ‘string’ (length=-1 -> till the end)


indexof( partstr, str ) position of where partstr appears in str (-1 -> not in str)
Reply With Quote
  #11  
Old 10-01-2001, 06:08 AM
Guest
Posts: n/a
okay from what you said in the pm, you will help me on here....

I dont understand what goes in the ()...


Is the first one (server.jail)?
Reply With Quote
  #12  
Old 10-01-2001, 06:14 AM
ArmadeusWarlock ArmadeusWarlock is offline
Registered User
Join Date: Jun 2001
Posts: 373
ArmadeusWarlock is on a distinguished road
lol

OMG this is so easy its not even funny.
Also, I would tell you but I already made a script like this for my server so Ill just leave you be
Reply With Quote
  #13  
Old 10-01-2001, 06:26 AM
Guest
Posts: n/a
Quote:
Originally posted by Kaimetsu


We'll assume that the name to be removed is stored in the string "namestring".

startofname=indexof(#s(namestring),#s(server.jail) );
setstring server.jail,#e(0,startofname,server.jail)#e(starto fname+len(namestring),-1,server.jail);

That should do it, though it may grab one character too few or many. Test it and see what happens.
So this is the hole script?

setstring server.jail,#e(0,startofname,server.jail)#e(starto fname+len(namestring),-1,server.jail);
Reply With Quote
  #14  
Old 10-01-2001, 06:30 AM
Guest
Posts: n/a
Wait i mean this is the hole script?

PHP Code:
if (playerchats && startswith(Unjail Player,#c)) {
  
setstring server.jail,#e(0,indexof(#s(namestring),#s(server.jail)); ,server.jail)#e(indexof(#s(namestring),#s(server.jail)); +len(namestring),-1,server.jail);

Reply With Quote
  #15  
Old 10-01-2001, 09:11 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
Re: lol

Quote:
Originally posted by ArmadeusWarlock
OMG this is so easy its not even funny.
Also, I would tell you but I already made a script like this for my server so Ill just leave you be
haha this is easy
Reply With Quote
  #16  
Old 10-01-2001, 05:49 PM
Guest
Posts: n/a
Come on someone tell me...
Reply With Quote
  #17  
Old 10-01-2001, 06:12 PM
toad1413 toad1413 is offline
toad@graal:~$ ./Oldbie
Join Date: May 2001
Location: Aust.
Posts: 3,819
toad1413 is on a distinguished road
Send a message via ICQ to toad1413
Re: Re: lol

Quote:
Originally posted by btedji


haha this is easy
Then tell him how to do it if you think it's that easy.

I would help, but I don't know how to do that stuff yet.
__________________
Creator of the original 'spam' icon. Worst mistake I ever made on these forums.
Reply With Quote
  #18  
Old 10-01-2001, 07:42 PM
toad1413 toad1413 is offline
toad@graal:~$ ./Oldbie
Join Date: May 2001
Location: Aust.
Posts: 3,819
toad1413 is on a distinguished road
Send a message via ICQ to toad1413
Quote:
Originally posted by Kaimetsu


Forget it, this is taking up far too much of my time and patience. Try some basic things first until you get good enough to move onto stuff like this.
Heh. I can't do that, mainly because I wouldn't ahve a clue what #e is for, and teh fact that I haven't ever done any work with stings before doesn't help.

Oh, and Kai, go on icq if possible.
__________________
Creator of the original 'spam' icon. Worst mistake I ever made on these forums.
Reply With Quote
  #19  
Old 10-02-2001, 03:11 AM
Guest
Posts: n/a
Come on someone please help me :*(
Reply With Quote
  #20  
Old 10-02-2001, 03:17 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
i'll make you one, just give me a couple minutes
Reply With Quote
  #21  
Old 10-02-2001, 03:18 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
Look at Aces tutorial a REALLY long time
The go to the commands.RTF and look at that.
__________________

subliminal message: 1+1=3
Reply With Quote
  #22  
Old 10-02-2001, 03:31 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
here ya go:

NPC Code:

// NPC made by bryan986
if (playerchats && startswith(Unjail Player,#c)) {
tokenize #c;
setstring server.jail,#e(0,(indexof(#t(2),#s(server.jail)))-1,#s(server.jail)) #e(indexof(#t(2),#s(server.jail))+strlen(#t(2))+1,-1,#s(server.jail));
}



this works, but you'll have to add testing to see if the player name is actually in the string or else if it doesnt it will mess up the string
Reply With Quote
  #23  
Old 10-02-2001, 03:43 AM
Guest
Posts: n/a
Quote:
Originally posted by btedji
here ya go:

NPC Code:

// NPC made by bryan986
if (playerchats && startswith(Unjail Player,#c)) {
tokenize #c;
setstring server.jail,#e(0,(indexof(#t(2),#s(server.jail)))-1,#s(server.jail)) #e(indexof(#t(2),#s(server.jail))+strlen(#t(2))+1,-1,#s(server.jail));
}



this works, but you'll have to add testing to see if the player name is actually in the string or else if it doesnt it will mess up the string
dude i dont know what you ment by testing it but it works and you are god!!!! )))))
Reply With Quote
  #24  
Old 10-02-2001, 03:51 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
NPC Code:

// NPC made by bryan986
if (playerchats && startswith(Unjail Player,#c)) {
tokenize #c;

if(#v(indexof(#t(2),#s(server.jail)))>-1){
setstring server.jail,#e(0,(indexof(#t(2),#s(server.jail)))-1,#s(server.jail)) #e(indexof(#t(2),#s(server.jail))+strlen(#t(2))+1,-1,#s(server.jail));
}

}



i added a test that checks to see if players name is in string so the string cant get messed up, see if that works
Reply With Quote
  #25  
Old 10-02-2001, 03:51 AM
Guest
Posts: n/a
Damn i knew it was to good to be true, it only lets to take off the end accounts...

like if their was server.jail= Joe jack roe
and i said Unjail jack it will set the server.jail= Jo roe
if i put it back to server.jail= Joe jack roe
and if i said Unjail roe it will set it server.jail= Joe jac

so it's a little messed up if you can fix it i will give you like 50 on graal 2001....
Reply With Quote
  #26  
Old 10-02-2001, 03:54 AM
Guest
Posts: n/a
Quote:
Originally posted by btedji
NPC Code:

// NPC made by bryan986
if (playerchats && startswith(Unjail Player,#c)) {
tokenize #c;

if(#v(indexof(#t(2),#s(server.jail)))>-1){
setstring server.jail,#e(0,(indexof(#t(2),#s(server.jail)))-1,#s(server.jail)) #e(indexof(#t(2),#s(server.jail))+strlen(#t(2))+1,-1,#s(server.jail));
}

}



i added a test that checks to see if players name is in string so the string cant get messed up, see if that works
umm their says their is a error with #v(indexof(#t(2),#s(server.jail)))

Error: Expected format var, var[i], obj[i].attr, function(a), function(a,b)
Reply With Quote
  #27  
Old 10-02-2001, 03:57 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
try this

NPC Code:

if (playerchats && startswith(Unjail Player,#c))
{ tokenize #c;

if(indexof(#t(2),#s(server.jail))>-1)
{
setstring server.jail,#e(0,(indexof(#t(2),#s(server.jail))), #s(server.jail))#e(indexof(#t(2),#s(server.jail))+ strlen(#t(2))+1,-1,#s(server.jail));
}

}

Reply With Quote
  #28  
Old 10-02-2001, 04:02 AM
Guest
Posts: n/a
DUDE YOU ROCK!!! DO YOU WANT SOME MONEY ON GRAAL 2001??? ALSO I want to do say2 when thay say that so it will say
say2 The player (the person you just unjailed) is now free...
Reply With Quote
  #29  
Old 10-02-2001, 04:04 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
say2 You unjailed #t(2) they are free.

add that into the main equation part
Reply With Quote
  #30  
Old 10-02-2001, 04:06 AM
Guest
Posts: n/a
ok now, the other part so like if their name is removed from that it will warp them to onlinestartlocal.graal
Reply With Quote
  #31  
Old 10-02-2001, 04:07 AM
Guest
Posts: n/a
what would it be somehting like
NPC Code:

if (playerenters||timeout){
if (!strcontains(#s(server.jail), #e(12,-1,#c))) {
setlevel2 onlinestartlocal.graal.graal,33,33;
}
}

Reply With Quote
  #32  
Old 10-02-2001, 04:07 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
just use the setlevel2 command in the main equation part, look in the commands.rtf to see how
Reply With Quote
  #33  
Old 10-02-2001, 04:09 AM
Guest
Posts: n/a
Quote:
Originally posted by Kaimetsu


Only criticism: What if their name is bigger than one word? It can happen.
arg true... I wouldnt know what to do then...
Reply With Quote
  #34  
Old 10-02-2001, 04:11 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
it would be better if you would use the string with account names only
Reply With Quote
  #35  
Old 10-02-2001, 04:12 AM
Guest
Posts: n/a
Quote:
Originally posted by btedji
it would be better if you would use the string with account names only
huh??
Reply With Quote
  #36  
Old 10-02-2001, 04:16 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
account names dont have spaces so you should only use them in the server.jail string
Reply With Quote
  #37  
Old 10-02-2001, 04:19 AM
Guest
Posts: n/a
Quote:
Originally posted by btedji
account names dont have spaces so you should only use them in the server.jail string
oh dude one more thing, you know like in the top of unstuck me place their is this thing where if you touch the guy it will show all the people in houses in white writing on the left, well can you do it where it will show all the people in jail?
Reply With Quote
  #38  
Old 10-02-2001, 04:20 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
d00d thats simple

just use the message command to show the server.jail string
Reply With Quote
  #39  
Old 10-02-2001, 04:26 AM
Guest
Posts: n/a
Dude you forgot, I dont know how to script stuff that good...
it will show them in a list like
1. account
2. account
3. account
ect....
Attached Images
 
Reply With Quote
  #40  
Old 10-02-2001, 04:29 AM
Aknts Aknts is offline
Level Designer
Aknts's Avatar
Join Date: Apr 2001
Location: USofA
Posts: 3,340
Aknts will become famous soon enough
Send a message via AIM to Aknts
He wants like showimg commands like
showimg blah,blah@blah@1. #s(server.jail),x,y;
But the only way I could think if you labeled each person with like server.jail1 and so on unless you can have a npc take everyones account in jail and tokenize them in individuals then tell it to say like showimg blah,blah@blah@1. #t(1)#s(server.jail)),x,y;
#t(1)#s(server.jail)),x,y; that is not going to work im not even looking at my commands so it was just showing you what you would need to do.
__________________
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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


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