/setadmin
#1

Well, I have system /odemote offline remove admin now how i can make it /odemote [playername] [admin level], I need to make it offline set admin
Код:
CMD:odemote(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] < 9999)
	{
		SendClientMessageEx(playerid, COLOR_WHITE, "{FF0000}ERROR{E3E3E3}: You have insufficient rights to use this certain command!");
		return 1;
	}

	new string[128], query[512], tmpName[MAX_PLAYER_NAME];
	if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /odemote [player name]");

	mysql_real_escape_string(params, tmpName);
	SetPVarString(playerid, "OnDemoted", tmpName);

	format(query,sizeof(query),"UPDATE `accounts` SET `AdminLevel` = 0 WHERE `Username`= '%s' AND `AdminLevel` < 99999 AND `AdminLevel` > 0",tmpName);
	mysql_function_query(MainPipeline, query, false, "OnDemoted", "ii", playerid, true);

	format(string,sizeof(string),"Attempting to demote %s's account.",tmpName);
	SendClientMessageEx(playerid,COLOR_YELLOW,string);
	return 1;
}

forward OnDemoted(index);
public OnDemoted(index)
{
	new string[128], name[24];
	GetPVarString(index, "OnDemoted", name, 24);

	if(mysql_affected_rows(MainPipeline)) {
		format(string, sizeof(string), "You have successfully demoted %s's account.", name);
		SendClientMessageEx(index, COLOR_WHITE, string);

		format(string, sizeof(string), "AdmCmd: %s was offline demoted by %s.", name, GetPlayerNameEx(index));
		Log("logs/odemote.log", string);
	}
	else {
		format(string, sizeof(string), "There was an issue with demoting %s's account.", name);
		SendClientMessageEx(index, COLOR_WHITE, string);
	}
	DeletePVar(index, "OnDemoted");

	return 1;
}
Reply
#2

HUUH?
Reply
#3

Quote:
Originally Posted by ShadeWalker
Посмотреть сообщение
HUUH?
Instead of illegally bumping, tell us what the exact problem is, what are we supposed to help you with?
Reply
#4

I have this System /odemote = offline fired(OFFILINE REMOVE ADMIN) now how i can make it /odemote [playername] [level] set offline admin level to remove
Reply
#5

for one, you are sending 2 values to 'OnDemoted', playerid, true. And your callback is OnDemoted(index);
Reply
#6

What?
Reply
#7

send me it with the new codes please
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)