04.06.2014, 19:54
Quote:
pawn Код:
|
pawn Код:
enum pInfo
{
pAdmin,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
CMD:setscore(playerid,params[])
{
new score;
new id;
new pName;
new aName;
new string[128];
GetPlayerName(playerid,pName,sizeof(pName));
GetPlayerName(id,aName,sizeof(aName));
if(sscanf(params, "ui", id, score)) return SendClientMessage(playerid,COLOR_RED,"USAGE:/setscore [id] [reason]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"Invalid playerid");
if(PlayerInfo[playerid][pAdmin] <4) return SendClientMessage(playerid,COLOR_RED,"You are not authorized to use this command");
format(string,sizeof(string),"Administrator %s has set your score to %d",pName,score);
SendClientMessage(id,COLOR_RED,string);
format(string,sizeof(string),"You have set %s's score to %d",aName,score);
SendClientMessage(playerid,COLOR_RED,string);
SetPlayerScore(id,score);
return 1;
}