Only admin can view
#1

Hello, i find this:

http://pastebin.com/9fBVnz1g

I know make command for admin like: /showplayerstatslabel.

Can someone tell me how to make this labels only for admin who used cmd for that.
Reply
#2

Hello!

Look at this function:
https://sampwiki.blast.hk/wiki/CreatePlayer3DTextLabel_DE

You can create a 3d text label for a specific player.
Reply
#3

Look at this, maybe itll help.

https://sampwiki.blast.hk/wiki/IsPlayerAdmin
Reply
#4

This is for RCON admins, but maybe he have an own admin system with own queries.
Reply
#5

Quote:
Originally Posted by Mencent
Посмотреть сообщение
This is for RCON admins, but maybe he have an own admin system with own queries.
Yes i have a own admin system.
Reply
#6

You have your own admi system but dont know how to make a command for admins only?

Код:
CMD:pl(playerid)
{
	if(pInfo[playerid][pAdmLevel] > 0) // change this to your own admin variable
	{
		if(! gPlayerLabel[playerid][E_LABEL_TOGGLED])//enable labels
		{
			new string[256];
			for(new i; i < MAX_PLAYERS; i++)
			{
				if(IsPlayerConnected(i))
				{
					if(i != playerid)
					{
						SetLabelString(string, playerid, i, sizeof(string));
						gPlayerLabel[playerid][E_3D_TEXT_LABEL][i] = CreateDynamic3DTextLabel(string, LABEL_COLOR, 0.0, 0.0, 0.0, LABEL_DRAW_DISTANCE, i, _, _, _, _, playerid, LABEL_STREAM_DISTANCE);
					}
				}
			}
		}
		else//disable labels
		{
			for(new i; i < MAX_PLAYERS; i++)
			{
				if(IsValidDynamic3DTextLabel(gPlayerLabel[playerid][E_3D_TEXT_LABEL][i]))
				{
					DestroyDynamic3DTextLabel(gPlayerLabel[playerid][E_3D_TEXT_LABEL][i]);
				}
			}
		}
		gPlayerLabel[playerid][E_LABEL_TOGGLED] = ! gPlayerLabel[playerid][E_LABEL_TOGGLED];
	}
	else return SendClientMessage(playerid, -1, "{FF0000}You are not authorized for this command.");
	return 1;
}
...
Reply
#7

Making admin commands, define the admin levels,
E.G
Код:
if(PlayerData[playerid][AdminLevel] < 1)
if(IsPlayerAdmin(playerid))
All using your variables that you have set to obtain levels.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)