How to save coords in px , py , pz ?
#1

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 ?
Reply
#2

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);
Reply
#3

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)