02.05.2015, 17:41
Hello,
I thought i'd make a simple command to teleport to a position i saved earlyer in a file.
The position it saved works perfect..however the loading/teleport doesnt teleport me.
It says 'invalid line' instead of setting my position
I thought i'd make a simple command to teleport to a position i saved earlyer in a file.
The position it saved works perfect..however the loading/teleport doesnt teleport me.
It says 'invalid line' instead of setting my position
pawn Код:
if(!strcmp(cmdtext, "/gopos", true))
{
if(fexist("mypos.txt"))
{
new File:IFile = fopen("mypos.txt", io_read), str[128];
while(fread(IFile, str))
{
if(str[0] == '#') continue;
new Float:X, Float:Y, Float:Z;
if(sscanf(str, "fff",X, Y, Z))
{
printf("(i) Invalid Line: %s", str);
}
else
{
SetPlayerPos(playerid, X, Y, Z);
}
}
fclose(IFile);
}
return 1;
}