SA-MP Forums Archive
Only admin can view - 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: Only admin can view (/showthread.php?tid=573700)



Only admin can view - TiXz0r - 09.05.2015

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.


AW: Only admin can view - Mencent - 09.05.2015

Hello!

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

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


Re: Only admin can view - SnG.Scot_MisCuDI - 09.05.2015

Look at this, maybe itll help.

https://sampwiki.blast.hk/wiki/IsPlayerAdmin


AW: Only admin can view - Mencent - 10.05.2015

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


Re: AW: Only admin can view - TiXz0r - 10.05.2015

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.


Re: Only admin can view - JaydenJason - 10.05.2015

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;
}
...


Re: Only admin can view - Stev - 10.05.2015

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.