Show name with sniper
#1

Hallo,

I want that if a player looks through the visor of a sniper, the names of the other players are displayed. I tried it just as it is not somehow

pawn Код:
if(GetPlayerWeapon(playerid) == 34 && !IsPlayerInAnyVehicle(playerid))
        {
            new PlayerText3D:snipertext[MAX_PLAYERS];
            if(PRESSED(KEY_HANDBRAKE))
                {
                    for(new i; i<MAX_PLAYERS;i++)
                        {
                            if(IsPlayerConnected(i))
                                {
                                            new Float:X, Float:Y, Float:Z;
                                            GetPlayerPos(i, X, Y, Z);
                                            new string[128];
                                            format(string,sizeof(string),"%s",PName[i]);
                                            snipertext[i] = CreatePlayer3DTextLabel(playerid,string,0x008080FF,X,Y,Z+1,315.0,i);
                                }
                        }
                }
            else if(RELEASED(KEY_HANDBRAKE))
                {
                    for(new i; i<MAX_PLAYERS;i++)
                        {
                            DeletePlayer3DTextLabel(playerid,snipertext[i]);
                        }
                }
        }
Reply
#2

From what you posted, you are just creating the 3DTextDraw, not actually attaching it to the player.

Edit: My apologies I misread your code, well try creating a normal textdraw and then attaching it to the player, I have certain labels for my gamemode, and this method worked for me (0.3 or 0.2 on the z axis should place it above the players head).
Reply
#3

1. i dont see any 3dtext
2. https://sampwiki.blast.hk/wiki/CreatePlayer3DTextLabel i attach it to the player
Reply
#4

But, only the sniper should see the names
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)