Creat3DTextLabel for admins?
#1

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
Reply
#2

You can use CreatePlayer3DTextLabel i think you need read wiki about this function: https://sampwiki.blast.hk/wiki/CreatePlayer3DTextLabel
Reply
#3

Hm, okey, thanks for response.
I'll try to do something with it.
Reply
#4

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...
Reply
#5

Just return it false if the player is not admin ?
Reply
#6

That one works Thx you all for answer
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)