[HELP]Textdraw showing coordinates - 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: [HELP]Textdraw showing coordinates (
/showthread.php?tid=497555)
[HELP]Textdraw showing coordinates -
Cryax98 - 27.02.2014
Hello,
I have done a Textdraw that shows the Coordinates XYZ when the player moves, for example:
I'm at point A and the coordinates are: x=111.111 y=222.222 z=333.333 and then i move to point B and
the coordinates now are: x=122.111 y=233.222 z=344.333
My problem is that when another player joins, the coordinates are going in "conflict", for example:
My coordinates are 111.111 - 222.222 - 333.333, and then i dont move i stay still at my position, when the
other player moves, i see his coordinates on the textdraw, but i want just see my coordinates, and not the
coordinates of all player in one textdraw..
whats wrong??
Код:
public OnPlayerUpdate(playerid)
{
new xbarv5_pcountstr[100];
format(xbarv5_pcountstr,sizeof(xbarv5_pcountstr),"Players: ~y~%d/%d",GetPlayersOnline(),GetMaxPlayers());
TextDrawSetString(xbar7, xbarv5_pcountstr);
new xbarv5_position[300];
new Float:textX, Float:textY, Float:textZ;
GetPlayerPos(playerid, textX, textY, textZ);
format(xbarv5_position, sizeof(xbarv5_position),"Pos: ~y~x=~g~%f ~y~y=~g~%f ~y~z=~g~%f", textX, textY, textZ);
TextDrawSetString(xbar9, xbarv5_position);
return 1;
}
Re: [HELP]Textdraw showing coordinates -
BroZeus - 27.02.2014
for this u have to use PlayerTextDrawSetString insteat of TextDrawSetString
see this for its usage PlayerTextDrawSetString
https://sampwiki.blast.hk/wiki/PlayerTextDrawSetString
Re: [HELP]Textdraw showing coordinates -
Cryax98 - 27.02.2014
ok, but i have to change all the TextDrawCreate etc. to PlayerTextdrawCreate etc. ?