PDA

View Full Version : Help Cars


Dark Crow
05/04/2012, 11:31 AM
Well i am using a GM that has it's own car ownership sistem but there's a problem when a player logs out his cars desapear untill he logs back again how can i make his cars to always be visible to everyone?

Riso135
05/04/2012, 11:35 AM
well, seek for it in OnPlayerDisconnect/Connect in that include/FS or whatever it is...

Dark Crow
05/04/2012, 11:48 AM
i looked there but i don't really know how the command would look like to make the cars desapear. :D i am still learning to script and don't know some things

Harish
05/04/2012, 12:09 PM
check this on playerdisconnect DestroyVehicle(playerid); and make it as comment and test it..

Dark Crow
05/04/2012, 01:00 PM
i commented it but it didn't work heres the whole

GetPlayerName(playerid, playername, sizeof(playername));
format(dateiname, sizeof(dateiname), "Vozila/%s.auto", playername);
new File: CarFile = fopen(dateiname, io_write);
format(var, 256, "AH_Typ=%i\n", Carlist[playerid][Typ]); fwrite(CarFile, var);
format(var, 256, "AH_X=%f\n", Carlist[playerid][X3]); fwrite(CarFile, var);
format(var, 256, "AH_Y=%f\n", Carlist[playerid][Y3]); fwrite(CarFile, var);
format(var, 256, "AH_Z=%f\n", Carlist[playerid][Z3]); fwrite(CarFile, var);
format(var, 256, "AH_Rot=%f\n", Carlist[playerid][Rotation]); fwrite(CarFile, var);
format(var, 256, "AH_Status=%i\n", Carlist[playerid][Status]); fwrite(CarFile, var);
format(var, 256, "AH_Lock=%i\n", Carlist[playerid][Lock]); fwrite(CarFile, var);
format(var, 256, "AH_Paintjob=%i\n", Carlist[playerid][Paintjob]); fwrite(CarFile, var);
format(var, 256, "AH_Color1=%i\n", Carlist[playerid][Color1]); fwrite(CarFile, var);
format(var, 256, "AH_Color2=%i\n", Carlist[playerid][Color2]); fwrite(CarFile, var);
format(var, 256, "AH_mod1=%i\n", Carlist[playerid][mod1]); fwrite(CarFile, var);
format(var, 256, "AH_mod2=%i\n", Carlist[playerid][mod2]); fwrite(CarFile, var);
format(var, 256, "AH_mod3=%i\n", Carlist[playerid][mod3]); fwrite(CarFile, var);
format(var, 256, "AH_mod4=%i\n", Carlist[playerid][mod4]); fwrite(CarFile, var);
format(var, 256, "AH_mod5=%i\n", Carlist[playerid][mod5]); fwrite(CarFile, var);
format(var, 256, "AH_mod6=%i\n", Carlist[playerid][mod6]); fwrite(CarFile, var);
format(var, 256, "AH_mod7=%i\n", Carlist[playerid][mod7]); fwrite(CarFile, var);
format(var, 256, "AH_mod8=%i\n", Carlist[playerid][mod8]); fwrite(CarFile, var);
format(var, 256, "AH_mod9=%i\n", Carlist[playerid][mod9]); fwrite(CarFile, var);
format(var, 256, "AH_mod10=%i\n", Carlist[playerid][mod10]); fwrite(CarFile, var);
format(var, 256, "AH_mod11=%i\n", Carlist[playerid][mod11]); fwrite(CarFile, var);
format(var, 256, "AH_mod12=%i\n", Carlist[playerid][mod12]); fwrite(CarFile, var);
format(var, 256, "AH_mod13=%i\n", Carlist[playerid][mod13]); fwrite(CarFile, var);
format(var, 256, "AH_mod14=%i\n", Carlist[playerid][mod14]); fwrite(CarFile, var);
format(var, 256, "AH_mod15=%i\n", Carlist[playerid][mod15]); fwrite(CarFile, var);
format(var, 256, "AH_mod16=%i\n", Carlist[playerid][mod16]); fwrite(CarFile, var);
format(var, 256, "AH_mod17=%i\n", Carlist[playerid][mod17]); fwrite(CarFile, var);
fclose(CarFile);
if(Carlist[playerid][Carid]!=-1)
{
SetVehicleParamsForAll(Carlist[playerid][Carid],0,0);
//DestroyVehicle(Carlist[playerid][Carid]);
Carlist[playerid][Carid]=-1;
}

can you see why??

Riso135
05/04/2012, 01:29 PM
u got it at bottom ----> //DestroyVehicle(Carlist[playerid][Carid]);

Dark Crow
05/04/2012, 01:40 PM
I commented that but it still doesn't show the vehicles of other players that aren't online!