Jump to content

[REZOLVAT] Problema Burned.


TioO
 Share

Recommended Posts

Salut cum fac ca sa se salveze adminul dupa relog.

Comanda : 

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/name> <Admin Level>");

	if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID)
		return SCM(playerid, COLOR_GREY, "Acel player nu este conectat.");

	if(adminlevel < 0 || adminlevel > 6)
		return SCM(playerid, COLOR_GREY, "Invalid admin level. 0-6");

	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.");

	format(gString, 80, "Ai fost promovat la admin %d de %s", adminlevel, GetName(playerid));
	SCM(id, COLOR_LIGHTBLUE, gString);

	format(gString, 100, "AdmCmd: %s i-a setat lui %s admin level %d.", GetName(playerid), GetName(id), adminlevel);
	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;
}
Link to comment
Share on other sites

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]);

Acest query salveaza gradul de admin al jucatorului, nu se executa deoarece nu este complet. Functia MD5_Hash este bagata in comentariu, sterge "/*" si "*/".

Respecta si vei fi respectat.

 

BigInt Pawn:

Pacman C++: 

Snake C++:

Minesweeper C++:

 

mattbb.cash

leaks.ro

Link to comment
Share on other sites

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]);

Acest query salveaza gradul de admin al jucatorului, nu se executa deoarece nu este complet. Functia MD5_Hash este bagata in comentariu, sterge "/*" si "*/".

 

 

Acum primesc aceasta eroare  C:\Users\Dragut Mario\gmm.pwn(18094) : error 017: undefined symbol "DEFAULT_PASSWORD"

Aceasta este linia : 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]);

Edited by TioO
Link to comment
Share on other sites

Acum primesc aceasta eroare  C:\Users\Dragut Mario\gmm.pwn(18094) : error 017: undefined symbol "DEFAULT_PASSWORD"

Aceasta este linia : 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]);

#define DEFAULT_PASSWORD "parolata"

Adauga asta la inceputul gamemode-ului.

Respecta si vei fi respectat.

 

BigInt Pawn:

Pacman C++: 

Snake C++:

Minesweeper C++:

 

mattbb.cash

leaks.ro

Link to comment
Share on other sites

Cand intrii in joc tasteaza comanda [/key] si baga keya pe care o ai la DEFAULT_PASSWORD

 

sau daca nu, scoate de tot sistemu de securitate daca te depaseste.

Am un gamemode editat si acest sistem a fost scos.

Link to comment
Share on other sites

Am rezolvat. Pentru cei care intamplina aceasta problema iata aici rezolvarea.

1.Stergeti asta : 

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;

2.Si in loc de ea adaugati asta : 

new gQuery[128];

	format(gQuery, sizeof(gQuery), "UPDATE users SET `Admin`='%d', `HelpedPlayers`='0' WHERE `ID`='%d'", PlayerInfo[id][pAdmin], PlayerInfo[id][pSQLID]);
        mysql_tquery(SQL, gQuery, "", "");

	return true;

 

Edited by TioO
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...