PDA

View Full Version : startswith gs2 equivelant?


Prozac
02-07-2006, 12:09 AM
What is the startwith(part,str) equivelant in gs2?
I searched on the wiki and the Graal Bible and they only mention it under NPC server and old gscript.

for example, I am trying:


//#CLIENTSIDE
function onPlayerchats()
{
if (startswith("test",player.chat))
{
player.chat="test worked!"; // it never gets here when i say test
}
}


is there a gs2 version of this command? any suggestions?

Skyld
02-07-2006, 12:18 AM
if (str.starts("foo"))

talkingnoodle
02-07-2006, 05:38 AM
if (str.starts("foo"))

foo? wtf? why is everyone using that in scripts all of a sudden z.z

napo_p2p
02-07-2006, 05:48 AM
foo? wtf? why is everyone using that in scripts all of a sudden z.z

"foo" "bar" "foobar"

Been around forever.

Riot
02-07-2006, 11:35 PM
foo? wtf? why is everyone using that in scripts all of a sudden z.z

http://en.wikipedia.org/wiki/Metasyntactic_variable