View Single Post
  #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