Keny Posted July 6, 2018 Posted July 6, 2018 Cum pot pune reason la comanda /setadmin ? Am incercat si am 3 probleme, le puteti vedea in poza de mai jos, cand dau setadmin 0 7 test nu apare nimic dupa reason : ce pot face? Sursa } YCMD:setadmin(playerid, params[], help) { new id, adminlevel, gString[120]; if(PlayerInfo[playerid][pAdmin] < 6) return SCM(playerid, COLOR_WHITE, AdminOnly); if(sscanf(params, "ui", id, adminlevel)) return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/setadmin [playerid] [adminlevel] [reason]"); if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY, "Acel player nu este conectat."); if(adminlevel < 0 || adminlevel > 7) return SCM(playerid, COLOR_GREY, "Invalid admin level. 0-7"); if(PlayerInfo[id][pAdmin] > PlayerInfo[playerid][pAdmin]) return SCM(playerid, COLOR_GREY, "Nu poti folosi aceasta comanda pe acel player. Are admin level mai mare."); new reason[180]; format(gString, 80, "Ai fost promovat la admin level %d de catre %s, motiv: %s.", adminlevel, GetName(playerid), reason); SCM(id, COLOR_LIGHTBLUE, gString); format(gString, 100, "AdmCMD: %s a fost promovat de catre %s la admin level %d, motiv: %s.", 1, GetName(id), GetName(playerid), adminlevel, reason); SendAdminHelperMessage(COLOR_LOGS, gString); 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); } Iter_Add(PlayerAdmins, id); finishAchievement(id, 27); PlayerInfo[id][pAdmin] = adminlevel; new gQuery[180]; if(adminlevel >= 1) format(gQuery, sizeof(gQuery), "UPDATE users SET `Admin`='%d', `Security`='%s', `HelpedPlayers`='0' WHERE `ID`='%d'", PlayerInfo[id][pAdmin]/*, MD5_Hash(DEFAULT_PASSWORD)*/, PlayerInfo[id][pSQLID]); else UpdateVar(id, "Admin", PlayerInfo[id][pAdmin]); mysql_tquery(SQL, gQuery, "", ""); SetPVarInt(id, "SecurityPlayer", 0); return true; }
AlexxAdv Posted July 6, 2018 Posted July 6, 2018 (edited) Pune asa, if(sscanf(params, "uds[128]" Edited July 6, 2018 by AlexxAdv
Keny Posted July 6, 2018 Author Posted July 6, 2018 Chiar acum, AlexxAdv a spus: Pune asa, if(sscanf(params, "uds[128]" Unde ?
AlexxAdv Posted July 6, 2018 Posted July 6, 2018 if(sscanf(params, "uds[128]", id, adminlevel,reason)) return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/setadmin [playerid] [adminlevel] [reason]");
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now