Creat3DTextLabel for admins? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Creat3DTextLabel for admins? (
/showthread.php?tid=255096)
Creat3DTextLabel for admins? -
LetsOWN[PL] - 14.05.2011
Hello peeps, it's my first post here
Anyway, it is not an introduction section.
Can somebody tell me, how can I make a 3DTextLabel visible only for admins?
I've been looking for it on ******s, but I didn't found
I'll be gratefull for response.
Thanks
Re: Creat3DTextLabel for admins? -
Raimis_R - 14.05.2011
You can use CreatePlayer3DTextLabel i think you need read wiki about this function:
https://sampwiki.blast.hk/wiki/CreatePlayer3DTextLabel
Re: Creat3DTextLabel for admins? -
LetsOWN[PL] - 14.05.2011
Hm, okey, thanks for response.
I'll try to do something with it.
Re: Creat3DTextLabel for admins? -
alpha500delta - 14.05.2011
Well, you can try something like this:
pawn Код:
if(IsPlayerAdmin(playerid))//If the player is rcon admin
{
new Pos[3];
GetPlayerPos(Pos[0], Pos[1], Pos[2]);//Gets the players position
CreatePlayer3DTextLabel(playerid,"Test",0xFFFF00FF,X,Y,Z,40.0);//Creates the textlabel
}
I have not tested this code though...
Re: Creat3DTextLabel for admins? -
sleepysnowflake - 14.05.2011
Just return it false if the player is not admin ?
Re: Creat3DTextLabel for admins? -
LetsOWN[PL] - 14.05.2011
That one works
![Smiley](images/smilies/smile.png)
Thx you all for answer
Re: Creat3DTextLabel for admins? -
Biesmen - 14.05.2011
Quote:
Originally Posted by alpha500delta
Well, you can try something like this:
pawn Код:
if(IsPlayerAdmin(playerid))//If the player is rcon admin { new Pos[3]; GetPlayerPos(Pos[0], Pos[1], Pos[2]);//Gets the players position CreatePlayer3DTextLabel(playerid,"Test",0xFFFF00FF,X,Y,Z,40.0);//Creates the textlabel }
I have not tested this code though...
|
Ehm, not all admins can see this label, just the admin who typed the command.
It should be more like..
pawn Код:
if(strcmp(cmdtext, "/testlabel") == 0)
{
new Float:Pos[3];
GetPlayerPos(Pos[0], Pos[1], Pos[2]);
for(new i=0; i < MAX_PLAYERS; i++) // A loop through all players
{
if(IsPlayerConnected(i)) // It will only continue the script if the id "i" is connected.
{
if(IsPlayerAdmin(i)) // It will only continue if the ID is RCON admin
{
CreatePlayer3DTextLabel(i,"Test",0xFFFF00FF,X,Y,Z,40.0); // Show the label for all RCON admins
}
}
}
return 1;
}