Show name with sniper - 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: Show name with sniper (
/showthread.php?tid=454292)
Show name with sniper -
deathrunner - 28.07.2013
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]);
}
}
}
Re: Show name with sniper -
NotIntegrated - 28.07.2013
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).
Re: Show name with sniper -
deathrunner - 28.07.2013
1. i dont see any 3dtext
2.
https://sampwiki.blast.hk/wiki/CreatePlayer3DTextLabel i attach it to the player
Re: Show name with sniper -
deathrunner - 28.07.2013
But, only the sniper should see the names