23.12.2011, 18:40
Don't use "i" for player name, use "u" or "r". With that you can either put a part of the player's name, or their ID. Try the code below.
pawn Код:
dcmd_cage(playerid,params[])
{
if(AccInfo[playerid][Level] < 2)
return ErrorMessages(playerid, 5);
new id,string[128];
if(sscanf(params,"us",id,params)) return SendClientMessage(playerid, COLOR_GREEN,"USAGE: /cage [PlayerId] [reason]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_GREEN,"The Player is not connected!");
new pName[MAX_PLAYER_NAME];
new vName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,32);
GetPlayerName(id,vName,32);
CagePlayer(id);
format(string,sizeof string,"** ADMIN CAGE: %s has been caged - %s",vName,params);
SendClientMessageToAll(adminpink,string);
return 1;
}