SA-MP Forums Archive
How to save coords in px , py , pz ? - 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: How to save coords in px , py , pz ? (/showthread.php?tid=89545)



How to save coords in px , py , pz ? - Dj_maryo1993 - 02.08.2009

pawn Код:
new Float:ax, Float:ay, Float:az;
GetPlayerPos(playerid, ax , ay , az);
format(string, sizeof(string), "You have Coord x=%d ,y=%d ,z=%d" ,ax , ay , az);
SendClientMessage(playerid ,COLOR_BROWN , string);
I need this for saving in .ini , and there looks like
Код:
Coordx=112321
Coordy=112313
Coordz=123132
Any suggestions ?


Re: How to save coords in px , py , pz ? - member - 02.08.2009

Well if you're using ini, i'd suggest you check this excellent guide by Andre7777, it should help you out.

http://forum.sa-mp.com/index.php?topic=71935.0

Oh, and you're format for the code is incorrect. Change this:

pawn Код:
format(string, sizeof(string), "You have Coord x=%d ,y=%d ,z=%d" ,ax , ay , az);
to this:
pawn Код:
format(string, sizeof(string), "You have Coord x= %f ,y= %f ,z= %f" , Float:ax, Float:ay, Float:az);



Re: How to save coords in px , py , pz ? - Dj_maryo1993 - 02.08.2009

Works fine now , thx man , i thoud that %d is for numbers.


Re: How to save coords in px , py , pz ? - member - 02.08.2009

Yes, %d is for numbers just like %i

A co-ordinate is not a number it is a floating point number as the wiki says. (in SA-MP Floats are usually coordinates, health, armour and player's angle etc and not numbers)

Check out the Wiki: https://sampwiki.blast.hk/wiki/Format