SA-MP Forums Archive
/makeadmin - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /makeadmin (/showthread.php?tid=504418)



/makeadmin - ChristianIvann09 - 04.04.2014

When im a Level 99998 admin and i tried to make players 99999 admin. It will return SendClientMessage(playerid,COLOR_WHITE, "You cannot make players 99999 Admin. Only Server Owner can do that!");

But how can i do that?

Here is my /makeadmin code

Код:
CMD:makeadmin(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 99998)
	{

		new
		iAdminValue,
		iTargetID;

		if(sscanf(params, "ui", iTargetID, iAdminValue)) {
			SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid] [level]");
			SendClientMessageEx(playerid, COLOR_GRAD1, "Server Moderator[1], Junior Admin[2], General Admin[3], Senior Admin[4], Head Admin[1337]");
			SendClientMessageEx(playerid, COLOR_GRAD1, "Server Manager[1338], Server Co-Owner[99998], Server Owner[99999]");
		}
		else if(IsPlayerConnected(iTargetID))
		{
			new
			szMessage[47 + (MAX_PLAYER_NAME * 2)];

			PlayerInfo[iTargetID][pAdmin] = iAdminValue;
			format(szMessage, sizeof(szMessage), "AdmCmd: %s has promoted %s to a level %d admin.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID), iAdminValue);
			ABroadCast(COLOR_LIGHTRED,szMessage, 2);
			format(szMessage, sizeof(szMessage), "You have been promoted to a level %d admin by %s.", iAdminValue, GetPlayerNameEx(playerid));
			SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, szMessage);
			format(szMessage, sizeof(szMessage), "You have promoted %s to a level %d admin.", GetPlayerNameEx(iTargetID),iAdminValue);
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMessage);
		}
		else SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid player specified.");
	}
	else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
	return 1;
}
Thanks in advance!


Re: /makeadmin - Mriss - 04.04.2014

Quote:
Originally Posted by ChristianIvann09
Посмотреть сообщение
When im a Level 99998 admin and i tried to make players 99999 admin. It will return SendClientMessage(playerid,COLOR_WHITE, "You cannot make players 99999 Admin. Only Server Owner can do that!");

But how can i do that?

Here is my /makeadmin code

Код:
CMD:makeadmin(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 99998)
	{

		new
		iAdminValue,
		iTargetID;

		if(sscanf(params, "ui", iTargetID, iAdminValue)) {
			SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid] [level]");
			SendClientMessageEx(playerid, COLOR_GRAD1, "Server Moderator[1], Junior Admin[2], General Admin[3], Senior Admin[4], Head Admin[1337]");
			SendClientMessageEx(playerid, COLOR_GRAD1, "Server Manager[1338], Server Co-Owner[99998], Server Owner[99999]");
		}
		else if(IsPlayerConnected(iTargetID))
		{
			new
			szMessage[47 + (MAX_PLAYER_NAME * 2)];

			PlayerInfo[iTargetID][pAdmin] = iAdminValue;
			format(szMessage, sizeof(szMessage), "AdmCmd: %s has promoted %s to a level %d admin.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID), iAdminValue);
			ABroadCast(COLOR_LIGHTRED,szMessage, 2);
			format(szMessage, sizeof(szMessage), "You have been promoted to a level %d admin by %s.", iAdminValue, GetPlayerNameEx(playerid));
			SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, szMessage);
			format(szMessage, sizeof(szMessage), "You have promoted %s to a level %d admin.", GetPlayerNameEx(iTargetID),iAdminValue);
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMessage);
		}
		else SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid player specified.");
	}
	else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
	return 1;
}
Thanks in advance!
Why would a Lower Level Admin be able to make Admins Higher level than themself?


Re: /makeadmin - ChristianIvann09 - 04.04.2014

Quote:
Originally Posted by Mriss
Посмотреть сообщение
Why would a Lower Level Admin be able to make Admins Higher level than themself?
Thats why i need your help when im the 99998 admin i cant make players 99999 admin even theirself cant make 99999 admin


Re: /makeadmin - biker122 - 04.04.2014

Simple mistake.
pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 99998)
It means if the player level is more than or equal to 99998, you cannot use it.
> - More. < - Less
Just change it to
pawn Код:
if(PlayerInfo[playerid][pAdmin] <= 99998)
and you're done!
and also, if you want a 99998'th level admin to use this command, then use this
pawn Код:
if(PlayerInfo[playerid][pAdmin] < 99998)
JUST CHANGE THAT LINE and you're done!


Re: /makeadmin - Bingo - 04.04.2014

Quote:
Originally Posted by biker122
Посмотреть сообщение
Simple mistake.
pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 99998)
It means if the player level is more than or equal to 99998, you cannot use it.
> - More. < - Less
Just change it to
pawn Код:
if(PlayerInfo[playerid][pAdmin] <= 99998)
and you're done!
and also, if you want a 99998'th level admin to use this command, then use this
pawn Код:
if(PlayerInfo[playerid][pAdmin] < 99998)
JUST CHANGE THAT LINE and you're done!
Yes, This same was explained by me in another thread of him, But i dont know how he is reading.


Firstly you need to set yourself as 99999 this can be done through scriptfiles/account whatever your directory is, You cant use if you are 99998 too.

Because in script we defined :-
pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 99998)
If player is having greater than 99998 can use this command, Even if you are 99998 you can't use this cmd even though you are logged in as RCON because you need to be greater than 99998 and ie; 99999.

And change > to < and you are done.


Re: /makeadmin - BigBrainAFK - 04.04.2014

who need 99999 adminlevels?


Re: /makeadmin - ChandraLouis - 04.04.2014

Show me your OnPlayerDisconnect Code


Re: /makeadmin - biker122 - 04.04.2014

Quote:
Originally Posted by BigBrainAFK
Посмотреть сообщение
who need 99999 adminlevels?
Why do you even care about it? It's his wish..

@ChandraLouis : I hope I've given him a solution to use that command.


Re: /makeadmin - Bingo - 04.04.2014

Quote:
Originally Posted by BigBrainAFK
Посмотреть сообщение
who need 99999 adminlevels?
Haha!

Its not that as you thought.

Not:- /makeadmin [id] [1-99999]

Normaly levels maybe 5,6,10 but here we used 99999 to get full immunities.


Re: /makeadmin - ChuckyBabe - 04.04.2014

Here's the code

pawn Код:
CMD:makeadmin(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 99999)
    {

        new
        iAdminValue,
        iTargetID;

        if(sscanf(params, "ui", iTargetID, iAdminValue)) {
            SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid] [level]");
            SendClientMessageEx(playerid, COLOR_GRAD1, "Server Moderator[1], Junior Admin[2], General Admin[3], Senior Admin[4], Head Admin[1337]");
            SendClientMessageEx(playerid, COLOR_GRAD1, "Server Manager[1338], Server Co-Owner[99998], Server Owner[99999]");
        }
        else if(IsPlayerConnected(iTargetID))
        {
            new
            szMessage[47 + (MAX_PLAYER_NAME * 2)];

            PlayerInfo[iTargetID][pAdmin] = iAdminValue;
            format(szMessage, sizeof(szMessage), "AdmCmd: %s has promoted %s to a level %d admin.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID), iAdminValue);
            ABroadCast(COLOR_LIGHTRED,szMessage, 2);
            format(szMessage, sizeof(szMessage), "You have been promoted to a level %d admin by %s.", iAdminValue, GetPlayerNameEx(playerid));
            SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, szMessage);
            format(szMessage, sizeof(szMessage), "You have promoted %s to a level %d admin.", GetPlayerNameEx(iTargetID),iAdminValue);
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMessage);
        }
        else SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid player specified.");
    }
    else SendClientMessageEx(playerid, COLOR_GRAD1, "You are a fucker! You can't do this !");
    return 1;
}
+rep if i help