25.05.2012, 07:56
pawn Код:
COMMAND:id(playerid,params[])
{
new Msg[128], Name, Msgname[24]; // Gives the variables for the /id command
if (sscanf(params, "u[24]", Name)) // Check if the player has typed the command correctly
{
SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/id <Part of name/name>\""); // else send how it should be.
}
else
{
if (IsPlayerConnected(Name)) // Check if the other player is connected
{
GetPlayerName(Name, Msgname, sizeof(Msgname));
format(Msg, 128, "Name/ID is: %s(%i)", Msgname, Name);
SendClientMessage(playerid, 0xFF0000AA, Msg);
}
}
return 1;
}