Author Topic: is this script messed up?  (Read 938 times)

this is my script:

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

i dont know why but for some reason it just wont work. If theres something wrong with it please tell me. thanks

this is my script:

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

i dont know why but for some reason it just wont work. If theres something wrong with it please tell me. thanks

I think messageAll takes two arguments. Like this.
 messageAll ("",'',<color:ffffff> <font:impact:30> findclientbyname (%target).name@"<color:ffffff> <font:impact:30> is a piece of poop, OMG!");

I think messageAll takes two arguments. Like this.
 messageAll ("",'',<color:ffffff> <font:impact:30> findclientbyname (%target).name@"<color:ffffff> <font:impact:30> is a piece of poop, OMG!");
Nope, only one. Yet he messed it up, It should be:
Code: [Select]
messageAll ('',"\c2"@%target.name@"\c5 is a piece of poop!");

Code: [Select]
messageAll ('',"<color:ffffff><font:impact:30>" @ findclientbyname(%target).name @ " is a piece of poop, OMG!");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.
« Last Edit: June 23, 2010, 12:58:22 PM by Headcrab Zombie »

I think messageAll takes two arguments. Like this.
 messageAll ("",'',<color:ffffff> <font:impact:30> findclientbyname (%target).name@"<color:ffffff> <font:impact:30> is a piece of poop, OMG!");
Well i looked on the rtb wiki and it only took one.....

Code: [Select]
messageAll ('',"<color:ffffff><font:impact:30>" @ findclientbyname(%target).name @ " is a piece of poop, OMG!");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.
Oh, okay then :/

umm i tryed heeds idea but it didnt work

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: [Select]
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!");
      }
   }
}
Fixed what you wrote.


Code: [Select]
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!");
      }
   }
}
A shorter way to do the same thing

thank you red guy im fixing it right now