15.05.2010, 18:39
Hello.
Listen guys i tried to make two commands that allows you to save your position by using /s and then load it by using /l.
Here is what I've done:
And the /l :
I know the /l is totally messed up and it's not working >:
But the /s is working,it creates a file with the positions in it, i just don't know how to read it.
Anyone help please?
Thanks in advance.
Listen guys i tried to make two commands that allows you to save your position by using /s and then load it by using /l.
Here is what I've done:
pawn Код:
if(strcmp(cmdtext, "/s", true) == 0)
{
new File:Pos=fopen("Pos.txt",io_write);
new Float:x, Float:y, Float:z;
new string[256];
GetPlayerPos(playerid,x,y,z);
format(string,256,"%f,%f,%f",x,y,z);
fwrite(Pos, string);
fclose(Pos);
return 1;
}
pawn Код:
if(strcmp(cmdtext, "/l", true) == 0)
{
new File:Pos=fopen("Pos.txt",io_read);
new string[256];
SetPlayerPos(playerid,x,y,z);
fread(Pos,string);
fclose(Pos);
return 1;
}
But the /s is working,it creates a file with the positions in it, i just don't know how to read it.
Anyone help please?
Thanks in advance.