SA-MP Forums Archive
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 0maxcars 1000maxcars++)
{
new 
iLoveKrustyKrab[128];
format(iLoveKrustyKrab128"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 0ik MAX_PLAYERSik++)
{
if(
Logged[ik] == 1)
{
OnPlayerDisconnect(ik0);
}
}
    return 
1;

And this is in OnGameModeInit pub:
PHP код:
    for(new i=0i<999i++)
    {
    new 
ch1[128];
    
format(ch1sizeof(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