Thread: Token problem
View Single Post
  #1  
Old 05-06-2007, 12:40 AM
Sum41Freeeeek Sum41Freeeeek is offline
Future Coder
Join Date: Feb 2004
Location: New York
Posts: 376
Sum41Freeeeek is on a distinguished road
Send a message via AIM to Sum41Freeeeek
Token problem

I'm making a gang system, but I'm having a small problem.
I have this in a class:

PHP Code:
function onPlayerchats()
{
  if (
player.chat.starts(":"))
  {
    
findNpc("Gang Control").leaderCommand(player.chat);
  }

and I have this in the Gang Control npc

PHP Code:
public function leaderCommand(toks)
{
  switch (
temp.toks[0])
  {
    case 
":addmember":
      
player.chat "testing";
    break;
  }

when I say :addmember alone, it switches my test to "testing" which is what I want, sort of (since I'm trying to debug it) but if I say :addmember blahwhatever, it doesn't do anything.

even if I changed it to player.chat = temp.toks[1]; , it doesn't return temp.toks[1] what am I doing wrong?

sorry if I don't explain it that well, I tried my best.
__________________
Frankie Cassini: ex-Era LAT
Quote:
Originally Posted by brakk View Post
omg just go to your room and draw a pony then

**** the chicken wings!
Reply With Quote