Quote:
Originally Posted by fowlplay4
Syntax: string.tokenize([delimiter])
delimiter - (Optional) string to break the string into tokens by, if you don't specify a delimiter it will be break it apart based on a space.
Examples:
PHP Code:
function onCreated() {
// Tokenize string with no passed delimiter.
temp.str = "Hello World!";
temp.tokens = temp.str.tokenize();
echo("tokens[0]" SPC temp.tokens[0]);
echo("tokens[1]" SPC temp.tokens[1]);
// Tokenize string with # passed as the delimiter.
temp.str = "Hello#World!";
temp.tokens = temp.str.tokenize("#");
echo("tokens[0]" SPC temp.tokens[0]);
echo("tokens[1]" SPC temp.tokens[1]);
}
|
So.....
PHP Code:
function onCreated()
{
// Tokenize string with # passed as the delimiter.
temp.str = "Thanks#Alot#Fowlplay4!";
temp.tokens = temp.str.tokenize("#");
echo("tokens[0]" SPC temp.tokens[0]);
echo("tokens[1]" SPC temp.tokens[1]);
echo("tokens[2]" SPC temp.tokens[2]);
}
This would make the weapon echo to the RC "Thanks Alot Fowlplay4"?
How could I apply this to playerchat?