SA-MP Forums Archive
y_ini problem - 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: y_ini problem (/showthread.php?tid=278689)



y_ini problem - Speed - 23.08.2011

My code goes like that:

pawn Code:
CMD:mypos(playerid, params[])
{
    new Float:x, Float:y, Float:z
    new INI:ini = INI_Open("pozicija.ini");
    GetPlayerPos(playerid, x,y,z);
    INI_WriteFloat(ini, "X", x);
    INI_WriteFloat(ini, "Y", y);
    INI_WriteFloat(ini, "Z", z);
    return 1;
}
Now he print:

X=x_pos
Y=y_pos
Z=z_pos

and i want that he print:

SetPlayerPos(playerid, x_pos, y_pos, z_pos);

but i dont now how to do that,... pls help :S


Re: y_ini problem - Pinguinn - 23.08.2011

I don't really get what you mean?
Explain it a bit more please


Re: y_ini problem - Speed - 23.08.2011

so, when i ingame type /mypos, i want that YINI store my position in this format:

SetPlayerPos(playerid, x_pos, y_pos, z_pos);

x_pos //
y_pos // That is coordinates iin game which I save
z_pos //


Re: y_ini problem - Pinguinn - 23.08.2011

You need GetPlayerPos if you want to store them
SetPlayerPos just sets a position of the player, it doesn't send data of the player's location


Re: y_ini problem - Speed - 23.08.2011

Quote:
Originally Posted by Speed
View Post
My code goes like that:

pawn Code:
CMD:mypos(playerid, params[])
{
    new Float:x, Float:y, Float:z
    new INI:ini = INI_Open("pozicija.ini");
    GetPlayerPos(playerid, x,y,z);
    INI_WriteFloat(ini, "X", x);
    INI_WriteFloat(ini, "Y", y);
    INI_WriteFloat(ini, "Z", z);
    return 1;
}
Now he print:

X=x_pos
Y=y_pos
Z=z_pos

and i want that he print:

SetPlayerPos(playerid, x_pos, y_pos, z_pos);

but i dont now how to do that,... pls help :S
here is command, now, when I am ingame i type /mypos, i exit game, go to the scriptfiles and there I find map name: "pozicija"

i open that map, and inside map i found:

X=x_position
Y=y_position
Z=z_position

and i want to find:

SetPlayerPos(playerid, x_position, y_position, z_position);

Can you get now?


Re: y_ini problem - SpankMe2 - 23.08.2011

before you open the ini file get the position it thinks the pos is inside the file not what you want to store