Blockland Forums > Modification Help
Why wont this work?
<< < (2/2)
Placid:

--- Quote from: Blocker Ctgr on September 02, 2011, 06:56:49 PM ---should be


--- Code: ---function serverCmdstuff(%name)
{
    findClientbyName(%name).clanPrefix=("ClanTagHere");
}
--- End code ---

--- End quote ---
should be


--- Code: ---function serverCmdstuff(%client)
{
    %client.clanPrefix="ClanTagHere";
}
--- End code ---

changed it to %client to make the variable more.. realistic.
%name would not actually be the name to my knowledge. %client is findclientbyname(yourname).getID();
and i don't think 3 slashes should screw anything up. seeing // should cancel out anything after that point.
Blocker Ctgr:

--- Quote from: Placid on September 02, 2011, 07:13:44 PM ---should be


--- Code: ---function serverCmdstuff(%client)
{
    %client.clanPrefix="ClanTagHere";
}
--- End code ---

changed it to %client to make the variable more.. realistic.
%name would not actually be the name to my knowledge. %client is findclientbyname(yourname).getID();
and i don't think 3 slashes should screw anything up. seeing // should cancel out anything after that point.

--- End quote ---

%name would have been /stuff playernamehere for it to change there tag.
Placid:

--- Quote from: Blocker Ctgr on September 02, 2011, 07:28:30 PM ---%name would have been /stuff playernamehere for it to change there tag.

--- End quote ---
1. OP was using '%this which generally refers to what is receiving that command, the client
2. that would still be wrong, it would be
--- Quote from: Blocker Ctgr on September 02, 2011, 06:56:49 PM ---
--- Code: ---function serverCmdstuff(%client,%name)
{
    if(!isObject(findClientByName(%name))
        return messageClient(%client,'',"Could not find client '" @ %name @ "'.");
    findClientbyName(%name).clanPrefix="ClanTagHere";
}
--- End code ---

--- End quote ---
(with the unnecessary clientcheck)
Headcrab Zombie:

--- Quote from: Blocker Ctgr on September 02, 2011, 07:28:30 PM ---%name would have been /stuff playernamehere for it to change there tag.

--- End quote ---
You have no clue what you're talking about and should stop trying to help people until you do.

Anyways, the correct code depends on who you want it to affect - If you want the command to change the clan tag of the person who uses it, then use the code in Placid's first post. If you want it to allow one player to change another player's clan tag, use the code in his second post (you should also add an admin check to it)
Navigation
Message Index
Previous page

Go to full version