Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- YCMD:setadmin(playerid, params[], help)
- {
- if(IsPlayerConnected(playerid)) {
- if(PlayerInfo[playerid][pAdmin] < 6) return SCM(playerid, COLOR_ERROR, "{ff0000}ERROR >>> {ff5252}Nu ai acces sa folosesti aceasta comanda{ff0000}.");
- new id,adminlevel,sendername[30],giveplayer[30],string[200];
- if(sscanf(params, "ui",id,adminlevel)) return SendClientMessage(playerid, COLOR_GREY, "Sintaxa: {FFFFFF}/setadmin <playerid/name> <Admin Level>");
- if(IsPlayerConnected(id)) {
- if(id != INVALID_PLAYER_ID)
- {
- GetPlayerName(id, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- PlayerInfo[id][pAdmin] = adminlevel;
- PlayerInfo[id][pChar] = 217;
- SetPlayerSkinEx(id, 217);
- printf("AdmCmd: %s has promoted %s to a level %d admin.", sendername, giveplayer, adminlevel);
- format(string, sizeof(string), "Ai fost promovat la admin %d de %s,", adminlevel, sendername);
- SendClientMessage(id, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "L-ai promovat pe %s la nivel %d admin.", giveplayer,adminlevel);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "AdmCmd: Admin %s i-a setat lui %s admin %d.", sendername,giveplayer,adminlevel);
- Iter_Add(PlayerAdmins, id);
- SendAdminMessage(COLOR_LOGS,string,4);
- new wakaname[25];
- if(adminlevel == 0) {
- PlayerInfo[id][pAW] = 0;
- UpdateVar(id, "AW", 0);
- SpecFaction[id] = 0;
- StopFly(playerid);
- UsedFly[playerid] = 0;
- SetPlayerHealthEx(playerid, 100);
- Iter_Remove(PlayerAdmins, id);
- }
- GetPlayerName(id,wakaname,25);
- new str[256];
- mysql_format(SQL, str,256,"UPDATE users SET `Admin`='%d',`CChar`='%d' WHERE `ID`='%d'",PlayerInfo[id][pAdmin],PlayerInfo[id][pChar],PlayerInfo[id][pSQLID]);
- mysql_tquery(SQL,str, "", "");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Acel player nu este conectat.");
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement