Server vehicle doesnt spawn on the second time. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Server vehicle doesnt spawn on the second time. (
/showthread.php?tid=421619)
Server vehicle doesnt spawn on the second time. -
Benjamin_Cortez - 10.03.2013
PHP код:
public OnGameModeExit()
{
FadeExit();
for(new maxcars = 0; maxcars < 1000; maxcars++)
{
new iLoveKrustyKrab[128];
format(iLoveKrustyKrab, 128, "Vehicles/%d.ini", maxcars);
if(!dfile_FileExists(iLoveKrustyKrab)) continue;
dfile_Open(iLoveKrustyKrab);
dfile_WriteInt("Spawned", 0);
dfile_SaveFile();
dfile_CloseFile();
printf("Vehicle File %d changed to spawned 0", maxcars);
}
for(new ik = 0; ik < MAX_PLAYERS; ik++)
{
if(Logged[ik] == 1)
{
OnPlayerDisconnect(ik, 0);
}
}
return 1;
}
And this is in OnGameModeInit pub:
PHP код:
for(new i=0; i<999; i++)
{
new ch1[128];
format(ch1, sizeof(ch1), "Vehicles/%d.ini", i);
if(dfile_FileExists(ch1))
{
dfile_Open(ch1);
if(dfile_ReadInt("Server") == 1)
{
LoadVehicle(i);
dfile_SaveFile();
dfile_CloseFile();
}
}
}
It works but only once, it saves the vehicle file once and the next time it deletes all the contain and doesn't spawn the vehicle. (Two GMXs.)
Re: Server vehicle doesnt spawn on the second time. -
Benjamin_Cortez - 10.03.2013
BUMP
Re: Server vehicle doesnt spawn on the second time. -
ExpertSahil - 10.03.2013
ARe you using streamer plugin to create that vehicles?
Look
here for more information
Re: Server vehicle doesnt spawn on the second time. -
Benjamin_Cortez - 10.03.2013
I mean, one the second I restart the server it deletes all the contain of the vehicle file.
Re: Server vehicle doesnt spawn on the second time. -
Benjamin_Cortez - 10.03.2013
bump
Re: Server vehicle doesnt spawn on the second time. -
Benjamin_Cortez - 11.03.2013
bump