vehicle system
#6

Woooooooooooooww arrays are much heavier than non-arrays variables. Thank you for the first link, I definetely learned the difference now.

Current code:
PHP код:
forward public LoadVehicleData(vehicleIDname[], value[]);
public 
LoadVehicleData(vehicleIDname[], value[])
{
    new 
location[32];
    
INI_Int("Model"VehicleInfo[vehicleID][vModel]);
    for(new 
04i++)
    {
        
format(locationsizeof location"Location: %i"i);
        
INI_Float(locationVehicleInfo[vehicleID][vLoc][i]);
    }
    
INI_WriteFloat(dFile"LocationX"VehicleInfo[vehicleID][vLoc][0]);
    
INI_WriteFloat(dFile"LocationY"VehicleInfo[vehicleID][vLoc][1]);
    
INI_WriteFloat(dFile"LocationZ"VehicleInfo[vehicleID][vLoc][2]);
    
INI_Int("Color 1"VehicleInfo[vehicleID][vColor1]);
    
INI_Int("Color 2"VehicleInfo[vehicleID][vColor2]);
    
INI_String("Owner"VehicleInfo[vehicleID][vOwner], MAX_PLAYER_NAME);
    
VehicleInfo[vehicleID][vLocked] = INI_Int("Locked") == true false;
    return 
1;
}

stock VehicleSave(vehicleID)
{
    new 
INI:dFile INI_Open(VehiclePath(vehicleID))
    new 
location[32];
    
INI_WriteInt(dFile"Model"VehicleInfo[vehicleID][vModel]);
    for(new 
04i++)
    {
         
format(locationsizeof location"Location: %i"i);
        
INI_Float(locationVehicleInfo[vehicleID][vLoc][i]);
    }
    
INI_WriteFloat(dFile"LocationX"VehicleInfo[vehicleID][vLoc][0]);
    
INI_WriteFloat(dFile"LocationY"VehicleInfo[vehicleID][vLoc][1]);
    
INI_WriteFloat(dFile"LocationZ"VehicleInfo[vehicleID][vLoc][2]);
    
INI_WriteInt(dFile"Color 1"VehicleInfo[vehicleID][vColor1]);
    
INI_WriteInt(dFile"Color 2"VehicleInfo[vehicleID][vColor2]);
    
INI_WriteInt(dFile"Owner"VehicleInfo[vehicleID][vOwner]);
    
INI_WriteInt(dFile"Locked"VehicleInfo[vehicleID][vLocked] ? 0);
    
INI_Close(dFile);
    return 
1;

Reply


Messages In This Thread
vehicle system - by saffierr - 01.01.2016, 02:29
Re: vehicle system - by Kucin666 - 01.01.2016, 02:35
Re: vehicle system - by AndySedeyn - 01.01.2016, 02:36
Re: vehicle system - by saffierr - 01.01.2016, 02:50
Re: vehicle system - by AndySedeyn - 01.01.2016, 02:59
Re: vehicle system - by saffierr - 01.01.2016, 03:58
Re: vehicle system - by AndySedeyn - 01.01.2016, 12:44
Re: vehicle system - by saffierr - 01.01.2016, 14:17

Forum Jump:


Users browsing this thread: 1 Guest(s)