if(IsPlayerConnected(playerid)){ if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "Vocк nгo pode acessar esse comando"); else if(IsPlayerAdmin(playerid)){ new id, uname[MAX_PLAYER_NAME], cargo[128], string[128], pname[MAX_PLAYER_NAME], string2[128]; if(sscanf(params, "us[128]", id, cargo)) return SendClientMessage (playerid, 0x00FF00AA, "Comando: /Setplayeradmin [ID] [CARGO]"); if(!IsPlayerConnected(id)) return SendClientMessage (playerid, 0xFF0000AA, "ID nгo conectado"); GetPlayerName(id, uname, sizeof(uname)); GetPlayerName(playerid, pname, sizeof(pname)); format(file, sizeof(file), Admin, uname); new str2[128], hour, minute, second; gettime(hour,minute,second); format(str2, sizeof(str2), "%d:%d:%d", hour, minute, second); DOF2_CreateFile(file); DOF2_SetString(file, "Cargo Staff", cargo); DOF2_SetString(file, "Promovido Por", pname); DOF2_SetString(file, "Hora", str2); |
CMD:daradmin(playerid, params[])
{
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid, 0xFF0000AA, "Vocк nгo pode acessar esse comando");
new
id,
cargo
;
if(sscanf(params, "ud", id, cargo))
return SendClientMessage (playerid, 0x00FF00AA, "Comando: /Setplayeradmin [ID] [CARGO(Nъmero)]");
if(!IsPlayerConnected(id))
return SendClientMessage (playerid, 0xFF0000AA, "ID nгo conectado");
PlayerAdmin[ID][pNivel] = cargo;
new file[64];
GetPlayerName(id, Name, sizeof(Name));
format(file, sizeof(file), Admin/*Caminho*/, uname);
new
str2[20],
hour,
minute,
second
;
gettime(hour,minute,second);
format(str2, sizeof(str2), "%d:%d:%d", hour, minute, second);
if(!DOF2_FileExists(file)) { DOF2_CreateFile(file); }
DOF2_SetInt(file, "Cargo Staff", PlayerAdmin[ID][pNivel]);
GetPlayerName(playerid, Name, sizeof(Name));
DOF2_SetString(file, "Promovido Por", Name);
DOF2_SetString(file, "Hora", str2);
return true;
}