Help /admins
#6

Is this the best way?
Code:
#include "a_samp"
#include "Pawn.CMD"

main(){}

new Admin[MAX_PLAYERS];
new SemiAdminLVL[MAX_PLAYERS];

public OnGameModeInit()
{
	return 1;
}
public OnGameModeExit()
{
	return 1;
}
CMD:admins(playerid, params[])
{
	new count = 0;

	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(!IsPlayerConnected(i)) continue;
		if(!Admin[i]) continue;

		new string[128];
		new pName[24];

		GetPlayerName(i, pName, sizeof(pName));

		switch(Admin[i])
		{
			case 1: format(string, sizeof(string), "Semi-Administrator [Level %d]: %s (ID: %d)", SemiAdminLVL, pName, i);
			case 2: format(string, sizeof(string), "Administrator: %s (ID: %d)", pName, i);
			case 3: format(string, sizeof(string), "Vice Head Admin: %s (ID: %d)", pName, i);
			case 4: format(string, sizeof(string), "Head Admin: %s (ID: %d)", pName, i);
			default: continue;
		}

		ShowPlayerDialog(playerid, 7777, DIALOG_STYLE_MSGBOX, "Online Administrators", string, "OK", "");

		count++;
	}
	if(!count) ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "No Administrators", "There are no Administrators Online", "OK", "");
	return 1;
}
CMD:rank1(playerid)
{
	Admin[playerid] = 2;
	return 1;
}
CMD:rank2(playerid)
{
	Admin[playerid] = 3;
	return 1;
}
CMD:rank3(playerid)
{
	Admin[playerid] = 4;
	return 1;
}
CMD:semi1(playerid)
{
	Admin[playerid] = 1;
	SemiAdminLVL[playerid] = 1;
	return 1;
}
CMD:semi2(playerid)
{
	Admin[playerid] = 1;
	SemiAdminLVL[playerid] = 2;
	return 1;
}
CMD:semi3(playerid)
{
	Admin[playerid] = 1;
	SemiAdminLVL[playerid] = 3;
	return 1;
}
Reply


Messages In This Thread
Help /admins - by KamilPolska - 27.06.2020, 15:31
Re: Help /admins - by ilogbc - 27.06.2020, 15:39
Re: Help /admins - by Lexless - 27.06.2020, 15:44
Re: Help /admins - by KamilPolska - 28.06.2020, 13:28
Re: Help /admins - by Kwarde - 28.06.2020, 15:13
Re: Help /admins - by KamilPolska - 28.06.2020, 17:55
Re: Help /admins - by Kwarde - 28.06.2020, 18:13
Re: Help /admins - by Chams - 28.06.2020, 18:47
Re: Help /admins - by KamilPolska - 05.07.2020, 17:39
Re: Help /admins - by DarkMaster - 09.07.2020, 11:13

Forum Jump:


Users browsing this thread: 1 Guest(s)