Author Topic: Simple Script Broken  (Read 447 times)

Can't get this to work.

It either gives everyone tags (without the comment in the if statement) or no one tags (not even me if there is the comment there)

Code: [Select]
package PreSufSet
{
    function gameConnection::onClientEnterGame(%this)
    {
        echo(%this.name @ " " @ %this.bl_id);
        parent::onClientEnterGame(%this);
    if((%this.bl_id = "3605")) //&& (%this.name = "Coburn"))
    {
    findClientByName(%this.name).clanPrefix=("<color:0000BB><font:Arial Bold Italic:24><shadow:4:4><shadowcolor:FFFFFF>IHas<font:Palatino Linotype:24><shadow:0:0>");
    findClientByName(%this.name).clanSuffix=("<color:0000BB><font:Arial Bold Italic:24><shadow:4:4><shadowcolor:FFFFFF>Tags<font:Palatino Linotype:24><shadow:0:0>");
    }
        else
        {
            return;
        }
    }
};

function bloopy()
{
    deactivatePackage(PreSufSet);
}
activatePackage(PreSufSet);

1. in if(), %this.bl_id isn't a string, don't use quotes, and replace = with ==.
2. findClientByName lines (both) - remove parenthesees at beginning [ ( ].

Otherwise it's fine.

Infact there's no need for findClientByName at all. %this is the client.

So just do %this.clanPrefix = "The stuff";
and %this.clanSuffix = "The other stuff";