View Single Post
  #1  
Old 06-24-2006, 04:33 PM
JustBreathe JustBreathe is offline
Registered User
Join Date: Jun 2006
Posts: 59
JustBreathe is on a distinguished road
onRCChat param messed.

PHP Code:
/npc<command> param

function onRCChat( param1, param2 )
  {
  echo( 
"Param1:" SPC param1 );
  echo( 
"Param2:" SPC param2 );
  } 
PHP Code:
/npcstuff 1
Param1
: stuff
Param2
: 1 
Alright.

PHP Code:
/npcstuff 1 2
Param1
: stuff,1 2
Param2
: 0 
PHP Code:
/npcstuff "1 2"
Param1: stuff
Param2
: 1 2 
PHP Code:
/npcstuff "1 2" "2 3"
Param1: stuff,"1 2" "2 3"
Param2: 0 
Does the same with params[0] / params[1].

Problem: When you input a /npccommand without quotes on multiple words, everything is dumped in the first param. with quotes, the command is dumped in the first param, and the second one is what's in quotes.

In short: Spaces causes the npc command to be dumped completely inside the first param.
Reply With Quote