13.04.2012, 07:57
Hello SA:MP!
I am having some trouble with SetPlayerName. I am trying to make an afk command that also sets the players name to "playername<AFK>"
However, it doesn't set my name. Any idea why![Huh?](images/smilies/confused.gif)
Here's the code:
Thanks for you help.
~ DBan
I am having some trouble with SetPlayerName. I am trying to make an afk command that also sets the players name to "playername<AFK>"
However, it doesn't set my name. Any idea why
![Huh?](images/smilies/confused.gif)
Here's the code:
pawn Код:
CMD:afk(playerid, params[])
{
new originalname[24], string[29]; //Created the variables
GetPlayerName(playerid, originalname, sizeof(originalname)); //Stored the player's name into the originalname variable
FM(fString, sizeof(fString), "%s is now <AFK>", GetName(playerid)); //Formatted fString
SendClientMessageToAll(cyellow, fString); //Sent fString
FM(string, sizeof(string), "%s<AFK>", originalname); //Formatted originalname to add <AFK>
SetPlayerName(playerid, string); //Set the player's name
return 1;
}
~ DBan