08.03.2012, 16:41
pawn Код:
CMD:setadmin(playerid, params[])
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
if(IsPlayerAdmin(playerid))
{
new leveladm, plid;
new string[128];
if(sscanf(params, "ud", plid, leveladm)) return SendClientMessage(playerid, -1, "Uso correto: /setadmin [ID] [Level]");
if(IsPlayerConnected(plid)) return SendClientMessage(playerid, -1, "Jogador Offline!");
if(leveladm >= 3) return SendClientMessage(playerid, -1, "O level mбximo й 3!");
if(IsPlayerConnected(plid))
{
if(leveladm >= 1)
{
InfoPlayer[plid][pAdmin] = leveladm;
//DOF2_SetInt(vfile, "LevelAdm",leveladm); // Dps vc ver se ta certo '-
DOF2_SetInt(vfile, "LevelAdm", InfoPlayer[playerid][pAdmin] = leveladm);
format(string, sizeof(string), "(INFO) Vocк foi promovido a Admin Level %d por : %s!", leveladm,aname);
SendClientMessage(plid,-1, string);
if(leveladm > 1) return 1;
}
if(leveladm == 0)
{
InfoPlayer[plid][pAdmin] = 0;
//DOF2_SetInt(vfile, "LevelAdm",0); // Dps vc ver se ta certo '-
DOF2_SetInt(vfile, "LevelAdm", InfoPlayer[playerid][pAdmin] = 0);
format(string, sizeof(string), "(x) %s , retirou seu admin!",aname);
SendClientMessage(plid,-1, string);
}
}
}
else
{
SendClientMessage(playerid, -1, "(INFO) Vocк nгo й um Administrador RCON.");
}
return 1;
}