Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-25-2004, 03:37 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Position of strings

Im just messing around wondering how would i get the postion of a string without tokenizeing the string... i've tried lindexof , indexof and triming the string and getting the var of each ... but none work, indexof was the closest thing to it but it gave the positon of the first letter in the entire string so say if i had
this.parts = one,two,three
indexof would give me 1,4,7
if it helps this is what i put when i trimed the string
NPC Code:

if(actionserverside)
sendtonc Debug:#p(0);
//#CLIENTSIDE
if(created){
setstring this.parts,skin,coat,sleeves,shoes,belt;
}
if(playerchats){
tokenize #c;
if(strcontains(#s(this.parts),#t(0))){
triggeraction 0,0,serverside,Player/Taylor,#e(indexof(#t(0),#s(this.parts)),strlen(#t( 0)),#s(this.parts))
,;
}
}


that gets me the string but i want the position of the string in the list
and this is with indexof
NPC Code:

if(actionserverside)
sendtonc Debug:#p(0);
//#CLIENTSIDE
if(created){
setstring this.parts,skin,coat,sleeves,shoes,belt;
}
if(playerchats){
tokenize #c;
if(strcontains(#s(this.parts),#t(0))){
triggeraction 0,0,serverside,Player/Taylor,#v(indexof(#t(0),#s(this.parts)))
,;
}
}


Last edited by ZeroTrack; 08-25-2004 at 03:48 PM..
Reply With Quote
 

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 07:51 PM.


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