Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 10-27-2001, 03:03 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Quote:
Originally posted by TDO2000
So tokenize ok (just show tokenize not tokenize2 if he knows the first the 2end is no problem either)


say u have a string like this:

blupp=I am a bastard

so if u do

tokenize #s(blupp);

every word is a token u can read from #t()
here it would be like this:
#t(0) = I
#t(1) = am
#t(2) = a
#t(3) = bastard

it's usefull if u wanna do a warper for example:

if(playerchats && startswith(warpto,#c)){
tokenize #c;
setlevel2 #t(1),strtofloat(#t(2)),strtofloat(#t(3));
}

useage: say warpto levelname x-pos ypos

u can read out how many tokens are made with the variable tokenscount for example
if(playerchats){
tokenize #c;
}
for(this.i=0;this.i < tokenscount;this.i++){
setstring sayed,#s(sayed) #t(this.i);
}

silly example but so u could write every token into this string (I used it for an hotel where u can buy a room and I use only one serverstring because of tokens =D)
I allready knew how to use em but that is one very good explanation ...
Reply With Quote
 


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 11:48 PM.


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