- 0
Comanda /makeadmin Problema
-
Similar Content
-
- 4 answers
- 569 views
-
Comanda /spec
By VAurel,
- 4 answers
- 188 views
-
- 3 replies
- 231 views
-
- 3 replies
- 192 views
-
- 2 replies
- 360 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
Question
InfernoZone
Salut am o problema am facut o comanda /makeadmin si nu reusesc sa fac ca cei care au gen admin 6 sa nu poate sa isi dea 7 sau asa sau sa nu poti trece de adm 6 cu /makeadmin va las comanda mai jos Ms mult
cmd:makeadmin(playerid, params[])
Edited by InfernoZone{
if(pInfo[playerid][pAdmin] >= 7)
{
new giveplayerid, level;
if(sscanf(params, "ud", giveplayerid, level)) return SendSyntaxMessage(playerid, "/makeadmin [playerid/name] [level]");
if(giveplayerid == INVALID_PLAYER_ID || pInfo[giveplayerid][pStatus] != 1) return SendClientMessage(playerid, COLOR_DARKGRAY, "Player not connected.");
pInfo[giveplayerid][pStaff] = 0;
if(level < 10 && level != 0)
{
new status[16];
if(level > pInfo[giveplayerid][pAdmin] ? format(status, sizeof(status), "promoted") : format(status, sizeof(status), "demoted"))
pInfo[giveplayerid][pAdmin] = level, Iter_Add(Stafff, giveplayerid);
format(AdminWText, sizeof(AdminWText), "Admcmd: %s has %s %s to Level %d Admin.", GetName(playerid), status, GetName(giveplayerid), level);
SendAdminMessage(playerid, COLOR_ADMWARNING, AdminWText);
format(stmsg[giveplayerid], 72, "Admin %s has %s your to Level %d Admin.", GetName(playerid), status, level);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, stmsg[giveplayerid]);
mysql_format(MySQLCon, quMYSQL, 100, "UPDATE `players` SET `Admin`=%d WHERE `ID`=%d", pInfo[giveplayerid][pAdmin], pInfo[giveplayerid][pID]), mysql_tquery(MySQLCon, quMYSQL);
return 1;
}
else if(level == 0)
{
if(pInfo[giveplayerid][pHelper] < 1) Iter_Remove(Stafff, giveplayerid), TextDrawHideForPlayer(giveplayerid, RHTXT);
pInfo[giveplayerid][pAdmin] = level;
format(AdminWText, sizeof(AdminWText), "Admcmd: %s has removed %s from the Admin Team.", GetName(playerid), GetName(giveplayerid));
SendAdminMessage(playerid, COLOR_ADMWARNING, AdminWText);
format(stmsg[giveplayerid], 72, "Admin %s has removed your from the Admin Team.", GetName(playerid));
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, stmsg[giveplayerid]);
mysql_format(MySQLCon, quMYSQL, 100, "UPDATE `players` SET `Admin`=%d WHERE `ID`=%d", pInfo[giveplayerid][pAdmin], pInfo[giveplayerid][pID]), mysql_tquery(MySQLCon, quMYSQL);
return 1;
}
else return SendClientMessage(playerid, COLOR_DARKGRAY, "Invalid Admin Level.");
}
else return SendClientMessage(playerid, COLOR_DARKGRAY, AdminError);
}
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.