Blockland Forums > Modification Help

is this script messed up?

Pages: << < (2/2)

Crysist:


--- Quote from: Headcrab Zombie on June 23, 2010, 12:53:51 PM ---
--- Code: ---messageAll ('',"<color:ffffff><font:impact:30>" @ findclientbyname(%target).name @ " is a piece of poop, OMG!");
--- End code ---
Crysist's wouldn't work because %target in nForce's function is part of a name, not a client, but his line refers to %target as a client

And though it isn't something that would make it not work, the color and font isn't the same as what he wanted.

--- End quote ---
Oh, okay then :/

nforce:

umm i tryed heeds idea but it didnt work


Red_Guy:

2 main errors.
- %client.name doesnt do anything.  use %client.getPlayerName() instead
- you have syntax errors in your messageAll, and in your initial "if"


--- Code: ---function serverCmdpoop (%client,%target)
{
   if (%client.isAdmin == True && isObject (findclientbyname(%target)))
   {
       echo("serverCmdpoop triggered by "@%client.getPlayerName() @" and was targetting "@findclientbyname(%target).getPlayername() @"!");
       if(isObject(findclientbyname(%target).player))
      {
         messageAll('',"<color:ffffff> <font:impact:30>" @ findclientbyname(%target).getPlayerName() @"<color:ffffff> <font:impact:30> is a piece of poop, OMG!");
      }
   }
}

--- End code ---
Fixed what you wrote.



--- Code: ---function serverCmdpoop (%client,%target)
{
 %targetClient=findclientbyname(%target);
 if (%client.isAdmin && isObject(%targetClient) )
   {
    echo("serverCmdpoop triggered by "@ %client.getPlayerName() @" and was targetting " @ %targetClient.getPlayername() @"!");
    if (isObject(%targetClient.player))
      {
       messageAll('',"<color:ffffff> <font:impact:30>" @ %targetClient.getPlayerName() @"<color:ffffff> <font:impact:30> is a piece of poop, OMG!");
      }
   }
}

--- End code ---
A shorter way to do the same thing

nforce:

thank you red guy im fixing it right now


Pages: << < (2/2)

Go to full version