Hey thats the code i made...
PHP Code:
public OnGameModeInit()
{
ServerRestarting=0;
new File:ftw=fopen("vehicles.txt", io_append),string[4000];
SetGameModeText("Wum Mode V.0");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(45, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
fread(ftw, string);
return 1;
}
CMD:veh(playerid,params[])
{
new vehid, Float:x, Float:y, Float:z, Float:rot, File:ftw=fopen("vehicles.txt", io_append),vehicles[300];
if(sscanf(params,"i",vehid)) return SendClientMessage(playerid,0xFF0000FF,"USAGE:/veh [vehicleid]");
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,rot);
AddStaticVehicle(vehid,x,y,z,rot,0,0);
format(vehicles,sizeof(vehicles)," AddStaticVehicle(%d,%f,%f,%f,%f,0,0);\r\n",vehid,x,y,z,rot);
fwrite(ftw,vehicles);
fclose(ftw);
return 1;
}
What I see is that you are trying to read the whole file like it would then be part of your code. Let me say this: "It won't work... EVER". It is more complex than that, the search function will get you there if you feel up to it!