05.01.2011, 20:01
Try:
Using: ZCMD and sscanf
EDIT: Just tested and it works, if you have problems it may be because of something else in your code.
pawn Код:
COMMAND:freeze(playerid, params[])
{
new name[MAX_PLAYER_NAME], ID, frozen[50];
if(IsPlayerAdmin(playerid))
{
if(sscanf(params, "u", ID)) SendClientMessage(playerid, 0xE60000FF, "USAGE: /spec [ID]");
else if(ID == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xE60000FF, "Player is not connected!");
else
{
GetPlayerName(ID, name, sizeof(name));
format(frozen, sizeof(frozen), "[SERVER]: %s has been frozen.", name);
TogglePlayerControllable(ID, 0);
SendClientMessageToAll(RED, frozen);
}
}
else return 0;
return 1;
}
EDIT: Just tested and it works, if you have problems it may be because of something else in your code.