waa......
i'm getting so much errors.. i've been trying to change all the intset to set (where needed)
and still...
maybe you can check my script?...
pawn Код:
public LoadCarSystem()
{
new string[128];
for(new i = 1; i < MAX_DVEHICLES; i++)
{
format(string,sizeof(string),"Vehicles/%i.ini",i);
if(dini_Exists(string))
{
CarSystem[i][cModel] = dini_Int(string, "Model");
CarSystem[i][cX] = dini_Float(string, "X");
CarSystem[i][cY] = dini_Float(string, "Y");
CarSystem[i][cZ] = dini_Float(string, "Z");
CarSystem[i][cAngle] = dini_Float(string, "Angle");
CarSystem[i][cColor1] = dini_Int(string, "Color1");
CarSystem[i][cColor2] = dini_Int(string, "Color2");
CarSystem[i][cDelay] = dini_Int(string, "Delay");
CarSystem[i][cObjective] = dini_Int(string, "Objective");
CarSystem[i][cDoorsLocked] = dini_Int(string, "DoorsLocked");
[b]CarSystem[i][cVehicleOwner] = dini_Set(string, "VehicleOwner");[/b]
CarSystem[i][cVehicleMaterials] = dini_Int(string, "VehicleMaterials");
CarSystem[i][cVehicleCrack] = dini_Int(string, "VehicleCrack");
CarSystem[i][cVehiclePot] = dini_Int(string, "VehiclePot");
CarSystem[i][cLoad] = dini_Int(string, "VehicleLoad");
CarSystem[i][cCapasity] = dini_Int(string, "VehicleCapasity");
[b]CarSystem[i][cVehicleHealth] = dini_Float(string, "VehicleHealth");[/b]
CarSystem[i][cVehicleAlarm] = dini_Int(string, "VehicleAlarm");
CarSystem[i][cVehicleOwned] = dini_Int(string, "VehicleOwned");
CarSystem[i][cNitro] = dini_Int(string, "Nitro");
CarSystem[i][cPaintJob] = dini_Int(string, "PaintJob");
CarSystem[i][cHydro] = dini_Int(string, "Hydro");
CarSystem[i][cPimped] = dini_Int(string, "Pimped");
CarSystem[i][cPerma] = dini_Int(string, "Perma");
CarSystem[i][cRank] = dini_Int(string, "Rank");
CarSystem[i][cPrice] = dini_Int(string, "Price");
CarSystem[i][cFileID] = i;
CarSystem[i][cVehicleID] = AddStaticVehicleEx(CarSystem[i][cModel],CarSystem[i][cX],CarSystem[i][cY],CarSystem[i][cZ],CarSystem[i][cAngle],CarSystem[i][cColor1],CarSystem[i][cColor2], CarSystem[i][cDelay]);
SetVehicleHealth(CarSystem[i][cVehicleID],CarSystem[i][cVehicleHealth]);
//ChangeVehicleColor(CarSystem[i][cVehicleID], CarSystem[i][cColor1], CarSystem[i][cColor2]);
//ChangeVehiclePaintjob(CarSystem[i][cVehicleID], CarSystem[i][cPaintJob]);
CarCount ++;
if(CarSystem[i][cPimped] == 1)
{
if(CarSystem[i][cModel] == 560)
{
AddVehicleComponent(i, 1026);
AddVehicleComponent(i, 1027);
AddVehicleComponent(i, 1028);
AddVehicleComponent(i, 1026);
AddVehicleComponent(i, 1032);
AddVehicleComponent(i, 1041);
}
if(CarSystem[i][cModel] == 562)
{
AddVehicleComponent(i, 1034);
AddVehicleComponent(i, 1036);
AddVehicleComponent(i, 1038);
AddVehicleComponent(i, 1040);
}
}
if(CarSystem[i][cNitro] == 1)
{
AddVehicleComponent(i, 1010);
}
if(CarSystem[i][cHydro] == 1)
{
AddVehicleComponent(i, 1087);
}
}
}
return true;
}
public LoadCarVehicle(vehicleid)
{
new string[128];
format(string,sizeof(string),"Vehicles/%i.ini",vehicleid);
if(dini_Exists(string))
{
CarSystem[vehicleid][cModel] = dini_Int(string, "Model");
CarSystem[vehicleid][cX] = dini_Float(string, "X");
CarSystem[vehicleid][cY] = dini_Float(string, "Y");
CarSystem[vehicleid][cZ] = dini_Float(string, "Z");
CarSystem[vehicleid][cAngle] = dini_Float(string, "Angle");
CarSystem[vehicleid][cColor1] = dini_Int(string, "Color1");
CarSystem[vehicleid][cColor2] = dini_Int(string, "Color2");
CarSystem[vehicleid][cDelay] = dini_Int(string, "Delay");
CarSystem[vehicleid][cObjective] = dini_Int(string, "Objective");
CarSystem[vehicleid][cDoorsLocked] = dini_Int(string, "DoorsLocked");
[b]CarSystem[vehicleid][cVehicleOwner] = dini_Set(string, "VehicleOwner");[/b]
CarSystem[vehicleid][cVehicleMaterials] = dini_Int(string, "VehicleMaterials");
CarSystem[vehicleid][cVehicleCrack] = dini_Int(string, "VehicleCrack");
CarSystem[vehicleid][cVehiclePot] = dini_Int(string, "VehiclePot");
CarSystem[vehicleid][cLoad] = dini_Int(string, "VehicleLoad");
CarSystem[vehicleid][cCapasity] = dini_Int(string, "VehicleCapasity");
[b]CarSystem[vehicleid][cVehicleHealth] = dini_Float(string, "VehicleHealth");[/b]
CarSystem[vehicleid][cVehicleAlarm] = dini_Int(string, "VehicleAlarm");
CarSystem[vehicleid][cVehicleOwned] = dini_Int(string, "VehicleOwned");
CarSystem[vehicleid][cNitro] = dini_Int(string, "Nitro");
CarSystem[vehicleid][cPaintJob] = dini_Int(string, "PaintJob");
CarSystem[vehicleid][cHydro] = dini_Int(string, "Hydro");
CarSystem[vehicleid][cPimped] = dini_Int(string, "Pimped");
CarSystem[vehicleid][cPerma] = dini_Int(string, "Perma");
CarSystem[vehicleid][cRank] = dini_Int(string, "Rank");
CarSystem[vehicleid][cPrice] = dini_Int(string, "Price");
CarSystem[vehicleid][cFileID] = vehicleid;
CarSystem[vehicleid][cVehicleID] = AddStaticVehicleEx(CarSystem[vehicleid][cModel],CarSystem[vehicleid][cX],CarSystem[vehicleid][cY],CarSystem[vehicleid][cZ],CarSystem[vehicleid][cAngle],CarSystem[vehicleid][cColor1],CarSystem[vehicleid][cColor2], CarSystem[vehicleid][cDelay]);
SetVehicleHealth(CarSystem[vehicleid][cVehicleID],CarSystem[vehicleid][cVehicleHealth]);
//ChangeVehicleColor(CarSystem[vehicleid][cVehicleID], CarSystem[vehicleid][cColor1], CarSystem[vehicleid][cColor2]);
//ChangeVehiclePaintjob(CarSystem[vehicleid][cVehicleID], CarSystem[vehicleid][cPaintJob]);
if(CarSystem[vehicleid][cPimped] == 1)
{
if(CarSystem[vehicleid][cModel] == 560)
{
AddVehicleComponent(vehicleid, 1026);
AddVehicleComponent(vehicleid, 1027);
AddVehicleComponent(vehicleid, 1028);
AddVehicleComponent(vehicleid, 1026);
AddVehicleComponent(vehicleid, 1032);
AddVehicleComponent(vehicleid, 1041);
}
if(CarSystem[vehicleid][cModel] == 562)
{
AddVehicleComponent(vehicleid, 1034);
AddVehicleComponent(vehicleid, 1036);
AddVehicleComponent(vehicleid, 1038);
AddVehicleComponent(vehicleid, 1040);
}
}
if(CarSystem[vehicleid][cNitro] == 1)
{
AddVehicleComponent(vehicleid, 1010);
}
if(CarSystem[vehicleid][cHydro] == 1)
{
AddVehicleComponent(vehicleid, 1087);
}
}
return true;
}
public SaveCarSystem()
{
new string[128];
for(new i = 1; i < MAX_DVEHICLES; i++)
{
format(string,sizeof(string),"Vehicles/%i.ini",i);
if(dini_Exists(string))
{
dini_IntSet(string, "Model", CarSystem[i][cModel]);
dini_FloatSet(string, "X", CarSystem[i][cX]);
dini_FloatSet(string, "Y", CarSystem[i][cY]);
dini_FloatSet(string, "Z", CarSystem[i][cZ]);
dini_FloatSet(string, "Angle", CarSystem[i][cAngle]);
dini_IntSet(string, "Color1", CarSystem[i][cColor1]);
dini_IntSet(string, "Color2", CarSystem[i][cColor2]);
dini_IntSet(string, "Delay", CarSystem[i][cDelay]);
dini_IntSet(string, "Objective", CarSystem[i][cObjective]);
dini_IntSet(string, "DoorsLocked", CarSystem[i][cDoorsLocked]);
dini_Set(string, "VehicleOwner", CarSystem[i][cVehicleOwner]);
dini_IntSet(string, "VehicleMaterials", CarSystem[i][cVehicleMaterials]);
dini_IntSet(string, "VehicleCrack", CarSystem[i][cVehicleCrack]);
dini_IntSet(string, "VehiclePot", CarSystem[i][cVehiclePot]);
dini_IntSet(string, "VehicleLoad", CarSystem[i][cLoad]);
dini_IntSet(string, "VehicleCapasity", CarSystem[i][cCapasity]);
dini_FloatSet(string, "VehicleHealth", CarSystem[i][cVehicleHealth]);
dini_IntSet(string, "VehicleAlarm", CarSystem[i][cVehicleAlarm]);
dini_IntSet(string, "VehicleOwned", CarSystem[i][cVehicleOwned]);
dini_IntSet(string, "Nitro", CarSystem[i][cNitro]);
dini_IntSet(string, "PaintJob", CarSystem[i][cPaintJob]);
dini_IntSet(string, "Hydro", CarSystem[i][cHydro]);
dini_IntSet(string, "Pimped", CarSystem[i][cPimped]);
dini_IntSet(string, "Perma", CarSystem[i][cPerma]);
dini_IntSet(string, "Rank", CarSystem[i][cRank]);
dini_IntSet(string, "Price", CarSystem[i][cPrice]);
}
}
return true;
}
public SaveCarVehicle(vehicleid)
{
new string[128];
format(string,sizeof(string),"Vehicles/%i.ini",vehicleid);
if(dini_Exists(string))
{
dini_IntSet(string, "Model", CarSystem[vehicleid][cModel]);
dini_FloatSet(string, "X", CarSystem[vehicleid][cX]);
dini_FloatSet(string, "Y", CarSystem[vehicleid][cY]);
dini_FloatSet(string, "Z", CarSystem[vehicleid][cZ]);
dini_FloatSet(string, "Angle", CarSystem[vehicleid][cAngle]);
dini_IntSet(string, "Color1", CarSystem[vehicleid][cColor1]);
dini_IntSet(string, "Color2", CarSystem[vehicleid][cColor2]);
dini_IntSet(string, "Delay", CarSystem[vehicleid][cDelay]);
dini_IntSet(string, "Objective", CarSystem[vehicleid][cObjective]);
dini_IntSet(string, "DoorsLocked", CarSystem[vehicleid][cDoorsLocked]);
dini_Set(string, "VehicleOwner", CarSystem[vehicleid][cVehicleOwner]);
dini_IntSet(string, "VehicleMaterials", CarSystem[vehicleid][cVehicleMaterials]);
dini_IntSet(string, "VehicleCrack", CarSystem[vehicleid][cVehicleCrack]);
dini_IntSet(string, "VehiclePot", CarSystem[vehicleid][cVehiclePot]);
dini_IntSet(string, "VehicleLoad", CarSystem[vehicleid][cLoad]);
dini_IntSet(string, "VehicleCapasity", CarSystem[vehicleid][cCapasity]);
dini_FloatSet(string, "VehicleHealth", CarSystem[vehicleid][cVehicleHealth]);
dini_IntSet(string, "VehicleAlarm", CarSystem[vehicleid][cVehicleAlarm]);
dini_IntSet(string, "VehicleOwned", CarSystem[vehicleid][cVehicleOwned]);
dini_IntSet(string, "Nitro", CarSystem[vehicleid][cNitro]);
dini_IntSet(string, "PaintJob", CarSystem[vehicleid][cPaintJob]);
dini_IntSet(string, "Hydro", CarSystem[vehicleid][cHydro]);
dini_IntSet(string, "Pimped", CarSystem[vehicleid][cPimped]);
dini_IntSet(string, "Perma", CarSystem[vehicleid][cPerma]);
dini_IntSet(string, "Rank", CarSystem[vehicleid][cRank]);
dini_IntSet(string, "Price", CarSystem[vehicleid][cPrice]);
}
return 1;
}
pawn Код:
public AddCar(carmodel,Float:x,Float:y,Float:z,Float:angle,color1,color2,delay,objective,doorslocked,vehicleowner,materials,crack,pot,load,capasity,health,alarm,owned,nitro,paintjob,hydro,pimped,perma,rank,price)
{
new FoundID = 0;
new ID;
new string[256];
if(carmodel > 399 && carmodel < 612)
{
for ( new i = 1; FoundID <= 0 ; i++)
{
format(string,sizeof(string),"Vehicles/%i.ini",i);
if(!dini_Exists(string))
{
ID = i;
FoundID = 1;
}
if( i > MAX_DVEHICLES )
{
return true;
}
}
format(string,sizeof(string),"Vehicles/%i.ini",ID);
dini_Create(string);
dini_IntSet(string, "Model", carmodel);
dini_FloatSet(string, "X", x);
dini_FloatSet(string, "Y", y);
dini_FloatSet(string, "Z", z);
dini_FloatSet(string, "Angle", angle);
dini_IntSet(string, "Color1", color1);
dini_IntSet(string, "Color2", color2);
dini_IntSet(string, "Delay", delay);
dini_IntSet(string, "Objective", objective);
dini_IntSet(string, "DoorsLocked", doorslocked);
[b]dini_Set(string, "VehicleOwner", vehicleowner);[/b]
dini_IntSet(string, "VehicleMaterials", materials);
dini_IntSet(string, "VehicleCrack", crack);
dini_IntSet(string, "VehiclePot", pot);
dini_IntSet(string, "VehicleLoad", load);
dini_IntSet(string, "VehicleCapasity", capasity);
dini_FloatSet(string, "VehicleHealth", health);
dini_IntSet(string, "VehicleAlarm", alarm);
dini_IntSet(string, "VehicleOwned", owned);
dini_IntSet(string, "Nitro", nitro);
dini_IntSet(string, "PaintJob", paintjob);
dini_IntSet(string, "Hydro", hydro);
dini_IntSet(string, "Pimped", pimped);
dini_IntSet(string, "Perma", perma);
dini_IntSet(string, "Rank", rank);
CarSystem[ID][cModel] = dini_Int(string, "model");
CarSystem[ID][cX] = x;
CarSystem[ID][cY] = y;
CarSystem[ID][cZ] = z;
CarSystem[ID][cAngle] = angle;
CarSystem[ID][cColor1] = color1;
CarSystem[ID][cColor2] = color2;
CarSystem[ID][cDelay] = delay;
CarSystem[ID][cObjective] = objective;
CarSystem[ID][cDoorsLocked] = doorslocked;
CarSystem[ID][cVehicleOwner] = vehicleowner;
CarSystem[ID][cVehicleMaterials] = materials;
CarSystem[ID][cVehicleCrack] = crack;
CarSystem[ID][cVehiclePot] = pot;
CarSystem[ID][cLoad] = load;
CarSystem[ID][cCapasity] = capasity;
CarSystem[ID][cVehicleHealth] = health;
CarSystem[ID][cVehicleAlarm] = alarm;
CarSystem[ID][cVehicleOwned] = owned;
CarSystem[ID][cNitro] = nitro;
CarSystem[ID][cPaintJob] = paintjob;
CarSystem[ID][cHydro] = hydro;
CarSystem[ID][cPimped] = pimped;
CarSystem[ID][cPerma] = perma;
CarSystem[ID][cRank] = rank;
CarSystem[ID][cPrice] = price;
CarSystem[ID][cFileID] = ID;
CarSystem[ID][cVehicleID] = AddStaticVehicleEx(CarSystem[ID][cModel],CarSystem[ID][cX],CarSystem[ID][cY],CarSystem[ID][cZ],CarSystem[ID][cAngle],CarSystem[ID][cColor1],CarSystem[ID][cColor2], CarSystem[ID][cDelay]);
CarCount ++;
}
else
{//Invalid Model
return true;
}
return ID;
}