y_ini problem
#1

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

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

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 //
Reply
#4

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
Reply
#5

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)