Hy all please help me,how to call the plr name?
Ex.:if (strcmp(cmd, "freeze", true) == 0)
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
if(IsPlayerAdmin(playerid))
{
new reason[256],plr;
tmp = strtok(cmdtext, idx),plr = FindPlayerIDFromString(tmp),reason = strtok(cmdtext, idx);
if (!strlen(tmp) || !strlen(reason)) SendClientMessage(playerid,0x41abd1AA, "[Syntax]: /c freeze [PlayerID] [Reason]");
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,0x41abd1AA,"Error: Not only player");
else
{
new string[256];
format(string,sizeof(string),"Admin:[ %s ] freezed
ID:[ %s ] Reason:[ %s ].",Name,
gPlayers[plr],cmdtext[strlen(tmp)+7]);
SendClientMessageToAll(0x41abd1AA, string);
SendClientMessage(plr,0x41abd1AA,"With admin freezed!");
TogglePlayerControllable(plr,0);
}
}
}
Photo:
Do not print the name,what could be wrong?
Thank.