SA-MP Forums Archive
A Position Command? - 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: A Position Command? (/showthread.php?tid=89502)



A Position Command? - Paradise671 - 02.08.2009

Can you help me, can you provide me with a code that shows your current position (X,Y,Z) like maybe a /pos command, i've seen it on some servers, cause i'm kind of new to GTA Server Development.


Re: A Position Command? - saiberfun - 02.08.2009

http://forum.sa-mp.com/index.php?topic=113839.0
or just search


Re: A Position Command? - Klutty - 02.08.2009

pawn Код:
if (strcmp("/pos", cmdtext, true, 10) == 0)
{
new Float:X;
new Float:Y;
new Float:Z;
new string[128];

format(string, sizeof(string), "You're current position is %f %f %f", Float:X, Float:Y, Float:Z);
SendClientMessage(playerid, color ,string); // change "color" to the color you want
return 1;
}
Untested.


Re: A Position Command? - SpiderPork - 02.08.2009

Quote:
Originally Posted by Klutty
pawn Код:
format(string, sizeof(string), "You're current position is %d %d %d", Float:X, Float:Y, Float:Z);
Untested.
%d should be %f, since you're putting float in your string.


Re: A Position Command? - Klutty - 02.08.2009

Quote:
Originally Posted by SpiderPork
Quote:
Originally Posted by Klutty
pawn Код:
format(string, sizeof(string), "You're current position is %d %d %d", Float:X, Float:Y, Float:Z);
Untested.
%d should be %f, since you're putting float in your string.
Thank you, edited my post.