SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 28/11/2010, 07:56 PM   #1
blackwave
Gangsta
 
Join Date: Oct 2010
Location: Fortaleza, Brazil
Posts: 967
Reputation: 7
Angry [SAVING BUG] How to do it?

There' s a simple bug on my vehicle system ( I think the last u_u ). And I bet it's on OnFilterScriptInit. Look;

Code:
 

public OnFilterScriptExit()
{
    new Float:x,Float:y,Float:z,Float:a;
    new str[64],Model;
    new count = 0;
    new File:CarFile = fopen(ARQUIVO_CARROS,io_write);
    for(new i=1; i < MAX_VEHICLES; i++)
    {
        if((Model=GetVehicleModel(i)))
        {
			count++;
			{
              GetVehiclePos(i,x,y,z);
              GetVehicleZAngle(i,a);
              format(str,64,"%d,%f,%f,%f,%f,%d,%d ;\r\n",Model,x,y,z,a,-1,-1);
              fwrite(CarFile,str);
            }
            else if(count == 0) return false;
        }
        
    }
    fclose(CarFile);
    return 1;
}
That saves and reload the cars normally, on same x,y,z and model. But when I destroy all cars of server, and I reload on close the FS (server console or /rcon reloadfs savecar), it deletes all cars saved before. And I'd like to know how to avoid it x=
__________________






My youtube user: Click here
blackwave is offline  
Old 28/11/2010, 10:04 PM   #2
randomkid88
Huge Clucker
 
Join Date: Mar 2010
Posts: 308
Reputation: 1
Default Re: [SAVING BUG] How to do it?

Only Bump after 48 hours...

But its doing what you tell it to. If you destroy all the cars, obviously there are no cars to save so it deletes all of the cars in your file. Its not an error. But you could try unloading the FS, destroying the cars, then reloading it. It wouldn't save anything since nothing changed.
randomkid88 is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[HELP] Skin Saving / Position Saving. andershh Help Archive 3 13/07/2010 11:20 AM
Good Dini/Dudb tutorial for file saving and info saving for example score ect JoeDaDude Help Archive 2 07/02/2010 10:04 PM
Saving .cfg Justsmile Help Archive 2 12/09/2009 08:44 AM


All times are GMT. The time now is 10:16 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.