Jump to content

[REZOLVAT] Comanda burned


CRISTIANN
 Share

Recommended Posts

 

 

 

 

YCMD:setadmin(playerid, params[], help) {

if(PlayerInfo[playerid][pAdmin] <6) return SendClientMessage(playerid, COLOR_WHITE, AdminOnly);

new id,adminlevel,string[200], reason[64], escape[200];

    if(sscanf(params, "uds[64]", id, adminlevel, reason)) return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/setadmin [playerid/name] [level] [reason]");

if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SendClientMessage(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 executa aceasta comanda pe acel player!");

 

format(string, sizeof(string), "Ai fost promovat la admin %d de %s, motiv: %s.", adminlevel, GetName(playerid), reason);

SendClientMessage(id, COLOR_LIGHTBLUE, string);

format(string, sizeof(string), "I-ai setat lui %s admin %d, motiv: %s.", GetName(id),adminlevel,reason);

SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

format(string, sizeof(string), "AdmCmd: %s i-a setat lui %s admin %d, motiv: %s.", GetName(playerid),GetName(id),adminlevel,reason);

if(GetPVarInt(playerid, "Cover") == 0) SendAdminMessage(COLOR_LOGS, string,4);

mysql_real_escape_string(string, escape);

 

if(adminlevel == 0) {

PlayerInfo[id][pAW] = 0;

UpdateVar(id, "AW", 0);

SpecFaction[id] = 0;

StopFly(playerid);

UsedFly[playerid] = 0;

SetPlayerHealthEx(playerid, 99);

SendClientMessage(playerid, 0xFFADADFF, "Fly mode off.");

}

else finishAchievement(id, 27);

PlayerInfo[id][pAdmin] = adminlevel;

 

new query[180];

 

if(adminlevel >= 1) format(query,sizeof(query),"UPDATE users SET `Admin`='%d', `Security`='%s',`HelpedPlayers`='0' WHERE `ID`='%d'",PlayerInfo[id][pAdmin], MD5_Hash(DEFAULT_PASSWORD), PlayerInfo[id][pSQLID]);

else format(query,sizeof(query),"UPDATE users SET `Admin`='%d' WHERE `ID`='%d'",PlayerInfo[id][pAdmin],PlayerInfo[id][pSQLID]);

mysql_query(SQL,query);

    mysql_format(SQL, query, sizeof(query), "INSERT INTO staff_logs (`text`) VALUES ('%s')", escape);

mysql_tquery(SQL,query,"","");

SetPVarInt(id, "SecurityPlayer", 0);

return 1;

 

 

 

 

 

 

 

 

 


YCMD:sethelper(playerid, params[], help) {

if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_WHITE, AdminOnly);

new id, string[180], lvl, reason[64], escape[200];

if(sscanf(params, "uds[64]", id, lvl, reason)) return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/sethelper [playerid/name] [level] [reason]");

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

if(lvl < 0 || lvl > 3) return SCM(playerid, COLOR_GREY, "Invalid helper level! (0-3)");

 

PlayerInfo[id][pHelper] = lvl;

if(lvl > 0) {

format(string, sizeof(string), "Ai fost promovat ca helper level %d de %s, Motiv: %s", lvl, GetName(playerid), reason);

SendClientMessage(id, COLOR_LIGHTBLUE, string);

format(string, sizeof(string), "I-ai setat lui %s helper %d", GetName(id));

SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

finishAchievement(id, 26);

}

else {

HelperDuty[playerid] = 0, HaveHelp[playerid] = -1;

format(string, sizeof(string), "Ai fost scos din functia de helper de %s pe motiv: %s", GetName(playerid), reason);

SendClientMessage(id, COLOR_LIGHTBLUE, string);

format(string, sizeof(string), "L-ai scos pe %s din functia de helper pe motiv: %s", GetName(id),reason);

SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

PlayerInfo[id][pHW] = 0;

UpdateVar(id, "HW", 0);

NewbieChat[playerid] = 0;

}

 

format(string, sizeof(string), "AdmCmd: %s i-a setat lui %s helper %d pe motiv: %s", GetName(playerid),GetName(id),lvl,reason);

if(GetPVarInt(playerid, "Cover") == 0) SendAdminMessage(COLOR_LOGS, string,4);

mysql_real_escape_string(string, escape);

new query[128];

format(query,sizeof(query),"UPDATE users SET `Helper`='%d',`HelpedPlayers`='0' WHERE `ID`='%d'",lvl,PlayerInfo[id][pSQLID]);

mysql_query(SQL,query);

mysql_format(SQL, query, sizeof(query), "INSERT INTO staff_logs (`text`) VALUES ('%s')", escape);

mysql_tquery(SQL,query,"","");

return 1;

}

 

 


 

 

 

}}

Edited by TwEnzY.VALOARE

      

Link to comment
Share on other sites

Aici ai /setadmin :

CMD:setadmin(playerid, params[]) {

	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, "System: %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;
}

Aici ai /sethelper :

CMD:sethelper(playerid, params[]) {

	new id, gString[180], helperlevel;

	if(PlayerInfo[playerid][pAdmin] < 6)
		return SCM(playerid, COLOR_WHITE, AdminOnly);

	if(sscanf(params, "ui", id, helperlevel))
		return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/sethelper <playerid/name> <level(0-3)>");

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

	if(helperlevel == 0) {
		Iter_Remove(HelpersDuty, 0);
		HaveHelp[playerid] = -1;

		format(gString, sizeof(gString), "Ai fost scos din functia de helper de catre %s", GetName(playerid));
		SCM(id, COLOR_LIGHTBLUE, gString);

		format(gString, sizeof(gString), "System: %s a fost scos din fucntia de helper level %d de catre %s", GetName(id), helperlevel, GetName(playerid));
		SendAdminHelperMessage(COLOR_LOGS, gString);

		PlayerInfo[id][pHW] = 0;
		UpdateVar(id, "HW", 0);
		NewbieChat[id] = 0;

		Iter_Remove(PlayerHelpers, playerid);

	}

	Iter_Add(PlayerHelpers, playerid);
	PlayerInfo[id][pHelper] = helperlevel;

	format(gString, sizeof(gString), "Ai fost promovat ca helper level %d de %s.", helperlevel, GetName(playerid));
	SCM(id, COLOR_LIGHTBLUE, gString);

	format(gString, sizeof(gString), "System: %s i-a setat lui %s helper level %d", GetName(playerid), GetName(id), helperlevel);
	SendAdminHelperMessage(COLOR_LOGS, gString);

	finishAchievement(id, 26);

	new gQuery[128];

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

	return true;
}
Link to comment
Share on other sites

 

Aici ai /setadmin :

CMD:setadmin(playerid, params[]) {

	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, "System: %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;
}

Aici ai /sethelper :

CMD:sethelper(playerid, params[]) {

	new id, gString[180], helperlevel;

	if(PlayerInfo[playerid][pAdmin] < 6)
		return SCM(playerid, COLOR_WHITE, AdminOnly);

	if(sscanf(params, "ui", id, helperlevel))
		return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/sethelper <playerid/name> <level(0-3)>");

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

	if(helperlevel == 0) {
		Iter_Remove(HelpersDuty, 0);
		HaveHelp[playerid] = -1;

		format(gString, sizeof(gString), "Ai fost scos din functia de helper de catre %s", GetName(playerid));
		SCM(id, COLOR_LIGHTBLUE, gString);

		format(gString, sizeof(gString), "System: %s a fost scos din fucntia de helper level %d de catre %s", GetName(id), helperlevel, GetName(playerid));
		SendAdminHelperMessage(COLOR_LOGS, gString);

		PlayerInfo[id][pHW] = 0;
		UpdateVar(id, "HW", 0);
		NewbieChat[id] = 0;

		Iter_Remove(PlayerHelpers, playerid);

	}

	Iter_Add(PlayerHelpers, playerid);
	PlayerInfo[id][pHelper] = helperlevel;

	format(gString, sizeof(gString), "Ai fost promovat ca helper level %d de %s.", helperlevel, GetName(playerid));
	SCM(id, COLOR_LIGHTBLUE, gString);

	format(gString, sizeof(gString), "System: %s i-a setat lui %s helper level %d", GetName(playerid), GetName(id), helperlevel);
	SendAdminHelperMessage(COLOR_LOGS, gString);

	finishAchievement(id, 26);

	new gQuery[128];

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

	return true;
}

multumesc.

 

dar stiti cum pot face sa nu trb sa dau admin si din baza de date??? deoarece daca dau cu /setadmin cand da relog ii se scoate admin si trb sa ii bag din baza de date

Link to comment
Share on other sites

multumesc.

 

dar stiti cum pot face sa nu trb sa dau admin si din baza de date??? deoarece daca dau cu /setadmin cand da relog ii se scoate admin si trb sa ii bag din baza de date

E mult de explicat incepe si tu pe alt gm trebuie sa scoti securitatea pnm..

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...