17.07.2010, 11:06
pawn Код:
dcmd_setadmin(playerid,params[])
{
new string[286];
new giveplayerid;
giveplayerid = strval(params);
new amount;
if(AdminLvl[playerid] <=3)
{
SendClientMessage(playerid,COLOR_RED,"You are not allowed to do this");
return 1;
}
if(sscanf(params,"ud",giveplayerid,amount))
{
SendClientMessage(playerid,COLOR_RED,"USAGE:/setadmin [playerid] [amount]");
return 1;
}
if(!IsPlayerConnected(giveplayerid))
{
SendClientMessage(playerid,COLOR_RED,"This player is not connected");
return 1;
}
AdminLvl[giveplayerid] = amount;
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),"Your admin level is setted to %d by %s",amount,playername);
SendClientMessage(giveplayerid,COLOR_RED,string);
GetPlayerName(giveplayerid,playername,sizeof(playername));
format(string,sizeof(string),"You have setted %s his admin level to %d",playername,amount);
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}

