avatar
ajutaima

Guest 123 26th Mar, 2019

                                           
                         if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
	if(IsPlayerConnected(playerid))
	{
		if (PlayerInfo[playerid][pFondator] >= 1)
		{
			new id,adminlevel,sendername[30],giveplayer[30],string[200],escape[200];
			if(sscanf(params, "ui",id,adminlevel)) return SendClientMessage(playerid, 0xFFFFFFFF, "{B8DBFF}Syntax: /setadmin` <Name/Playerid> <Admin Level>");
			if(IsPlayerConnected(id))
			{
			    if(id != INVALID_PLAYER_ID)
			    {
					GetPlayerName(id, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof(sendername));
					printf("{FFFFFF}({2D82D6}Admin Info{FFFFFF}) %s has promoted %s to a level %d admin.", sendername, giveplayer, adminlevel);
					format(string, sizeof(string), "You've been promoted to level %d admin, by %s.", adminlevel, sendername);
					SendClientMessage(id, COLOR_YELLOW, string);
					format(string, sizeof(string), "You have promoted %s to a level %d admin.", giveplayer,adminlevel);
					SendClientMessage(playerid, COLOR_YELLOW, string);
					format(string, sizeof(string), "* Admin %s set %s's admin level to %d.", sendername,giveplayer,adminlevel);
					ABroadCast(COLOR_ADMIN,string,1);
					HLChat(COLOR_ADMCHAT,string);
					mysql_real_escape_string(string, escape);
					PlayerInfo[id][pAdmin] = adminlevel;
					if(adminlevel == 0)
					{
						AdminDuty[id] = 0;
					}
					new str[256];
					mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Admin`='%d' WHERE `name`='%s'",PlayerInfo[id][pAdmin],PlayerInfo[id][pNormalName]);
					mysql_tquery(SQL,str,"","");
					mysql_format(SQL,str, sizeof(str), "INSERT INTO staff_logs (`text`) VALUES ('%s')", escape);
					mysql_tquery(SQL,str,"","");
				}
                      
                                       
Pentru a distribui această postare, copiați această adresă URL și trimiteți-o prietenilor
RAW Paste Data