zAlex_Alx
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
News
Documentation
Posts posted by zAlex_Alx
-
-
cum sterg cmd47?
cum sterg cmd47?
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.
Bug hpq123
in Discuţii scripting
Posted · Edited by zAlex_Alx
Salut, am gasit un bug la gm hpq123 legat de setadmin. Imi setez admin 8 (din baza de date) si dupa dau /setadmin si imi zice ca nu am access.
YCMD:setadmin(playerid, params[], help)
{
if(IsPlayerConnected(playerid)) {
if(PlayerInfo[playerid][pScripter] == 0) return SCM(playerid, COLOR_ERROR, "Nu ai access.");
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;
}