Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 02-24-2011, 02:11 AM
Astram Astram is offline
Era iPhone PR
Astram's Avatar
Join Date: Aug 2010
Posts: 324
Astram can only hope to improve
Send a message via AIM to Astram
Quote:
Originally Posted by fowlplay4 View Post
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?
__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!


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 12:32 AM.


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