23.03.2012, 14:00
Hello,
I saved vehicle coordinates in a .txt file and it looks like this;
444,2263.332275,-112.685447,27.088766,1.411218,0,0;Player
later if i go ingame the saved coordinates are capable of creating a vehicle at that location.
As you can see i also saved a name at the end of the file. Its from the one who placed it, in this case mine in debug.
now i want to know if its possible to just read a part of this line . the name of the player or the modelname of the car.
and how?
I tried this but it didnt work so far;
I saved vehicle coordinates in a .txt file and it looks like this;
444,2263.332275,-112.685447,27.088766,1.411218,0,0;Player
later if i go ingame the saved coordinates are capable of creating a vehicle at that location.
As you can see i also saved a name at the end of the file. Its from the one who placed it, in this case mine in debug.
now i want to know if its possible to just read a part of this line . the name of the player or the modelname of the car.
and how?
I tried this but it didnt work so far;
pawn Код:
if(strcmp("/readit",cmd,true)==0)
{
new string[156];
new File:tryit = fopen("vehicles/trains.txt",io_read); // Open the file
while(fread(tryit,string))
{
SendClientMessage(playerid,0xFFFFFF96,string); //-this one does work (whole line)
if(strcmp(string,"Player", true) == 0)//this part doesnt
{
SendClientMessage(playerid,0xFFFFFF96,"it says player");
printf("%s",string);
}
}
fclose(tryit);
return 1;
}