28.10.2011, 18:22
Hey thats the code i made...
But..it doesnt works..i mean on restart static vehicles dont add...help?
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;
}