A Vehicle mappába minden rendben van
LoadVehicle
stock LoadVehicle( vehicleid )
{
vInfo[vehicleid][MODEL] = dini_Int( vehicleFile(vehicleid), \"MODEL\" );
vInfo[vehicleid][X] = dini_Float( vehicleFile(vehicleid), \"X\" );
vInfo[vehicleid][Y] = dini_Float( vehicleFile(vehicleid), \"Y\" );
vInfo[vehicleid][Z] = dini_Float( vehicleFile(vehicleid), \"Z\" );
vInfo[vehicleid][A] = dini_Float( vehicleFile(vehicleid), \"A\" );
vInfo[vehicleid][color] = dini_Int( vehicleFile(vehicleid), \"COLOR\" );
vInfo[vehicleid][color2] = dini_Int( vehicleFile(vehicleid), \"COLOR2\" );
vInfo[vehicleid][sOLD] = dini_Int( vehicleFile(vehicleid), \"SOLD\" );
format( vInfo[vehicleid][PLATE], (,\"%s\", dini_Get( vehicleFile(vehicleid), \"PLATE\") );
vInfo[vehicleid][PRICE] = dini_Int( vehicleFile(vehicleid), \"PRICE\" );
vInfo[vehicleid][LOCKED] = dini_Int( vehicleFile(vehicleid), \"LOCKED\" );
vInfo[vehicleid][uZEMANYAGTIPUS] = dini_Int(vehicleFile(vehicleid), \"ÜzemanyagTipus\");
vInfo[vehicleid][uZEMANYAGTIPUSVAN] = dini_Int(vehicleFile(vehicleid), \"MilyenVanBenne\");
vInfo[vehicleid][MAXUZEMANYAG] = dini_Int(vehicleFile(vehicleid), \"MaxÜzemAnyag\");
vInfo[vehicleid][uZEMANYAG] = dini_Int(vehicleFile(vehicleid), \"ÜzemAnyag\");
vInfo[vehicleid][KEREKBILINCS] = dini_Int(vehicleFile(vehicleid), \"KerékBilincs\");
vehicleid = CreateVehicle( vInfo[vehicleid][MODEL], vInfo[vehicleid][X], vInfo[vehicleid][Y], vInfo[vehicleid][Z], vInfo[vehicleid][A],
vInfo[vehicleid][color], vInfo[vehicleid][color2], 0 );
SetVehicleNumberPlate( vehicleid, vInfo[vehicleid][PLATE] );
if (dini_Int(vehicleFile(vehicleid), \"Hidraulika\") == 1)
{
AddVehicleComponent(vehicleid, 1087);
}
if(dini_Int(vehicleFile(vehicleid), \"Kerék\") != 0)
{
AddVehicleComponent(vehicleid, dini_Int(vehicleFile(vehicleid), \"Kerék\"));
}
return 1;
}
SaveVehicle
stock SaveVehicle( vehicleid )
{
if(!dini_Exists(vehicleFile(vehicleid)) )
{
dini_Create( vehicleFile(vehicleid) );
}
dini_IntSet( vehicleFile(vehicleid), \"MODEL\", vInfo[vehicleid][MODEL] );
dini_FloatSet( vehicleFile(vehicleid), \"X\", vInfo[vehicleid][X] );
dini_FloatSet( vehicleFile(vehicleid), \"Y\", vInfo[vehicleid][Y] );
dini_FloatSet( vehicleFile(vehicleid), \"Z\", vInfo[vehicleid][Z] );
dini_FloatSet( vehicleFile(vehicleid), \"A\", vInfo[vehicleid][A] );
dini_IntSet( vehicleFile(vehicleid), \"COLOR\", vInfo[vehicleid][color] );
dini_IntSet( vehicleFile(vehicleid), \"COLOR2\", vInfo[vehicleid][color2] );
dini_IntSet( vehicleFile(vehicleid), \"SOLD\", vInfo[vehicleid][sOLD] );
dini_Set( vehicleFile(vehicleid), \"PLATE\", vInfo[vehicleid][PLATE] );
dini_IntSet( vehicleFile(vehicleid), \"PRICE\", vInfo[vehicleid][PRICE] );
dini_IntSet( vehicleFile(vehicleid), \"LOCKED\", vInfo[vehicleid][LOCKED] );
dini_IntSet(vehicleFile(vehicleid), \"ÜzemanyagTipus\", vInfo[vehicleid][uZEMANYAGTIPUS]);
dini_IntSet(vehicleFile(vehicleid), \"MilyenVanBenne\", vInfo[vehicleid][uZEMANYAGTIPUSVAN]);
dini_IntSet(vehicleFile(vehicleid), \"MaxÜzemAnyag\", vInfo[vehicleid][MAXUZEMANYAG]);
dini_IntSet(vehicleFile(vehicleid), \"ÜzemAnyag\", vInfo[vehicleid][uZEMANYAG]);
dini_IntSet(vehicleFile(vehicleid), \"KerékBilincs\", vInfo[vehicleid][KEREKBILINCS]);
return 1;
}
ReloadVehicle
stock ReloadVehicle( vehicleid )
{
DestroyVehicle( vehicleid );
vehicleid = CreateVehicle( vInfo[vehicleid][MODEL], vInfo[vehicleid][X], vInfo[vehicleid][Y], vInfo[vehicleid][Z], vInfo[vehicleid][A],
vInfo[vehicleid][color], vInfo[vehicleid][color2], 0 );
SetVehicleNumberPlate( vehicleid, vInfo[vehicleid][PLATE] );
AddVehicleComponent(vehicleid, dini_Int(vehicleFile(vehicleid),\"Kerék\"));
vInfo[vehicleid][bEINDITVA] = false;
SaveVehicle( vehicleid );
return 1;
}
Parancsoljatok