13.07.2014, 14:44
Well, I have a question.
I created a dialog which add to the vehicle nitro & hydraulics.
The nitro saved, but the hydraulics didn't save.
Here is the part of the code:
ENUMS:
DIALOG:
The part that should create the files:
A part of the stock:
OnVehicleSpawn:
I created a dialog which add to the vehicle nitro & hydraulics.
The nitro saved, but the hydraulics didn't save.
Here is the part of the code:
ENUMS:
Код:
enum veh
{
carmodel,
Float:fx,
Float:fy,
Float:fz,
Float:fa,
color1,
color2,
respawn,
carteam,
cartype, // 0 = driveable by all // 1 family restricted // 2 job restricted // 3 rentable
modeltype, //0 car // 1 heli // 2 plane // 3 boat
jobname[20],
biznumber,
plate[10],
tmplocked,
tmplockedby,
carowner[MAX_STRING],
carprice,
reset,
Components[CAR_COMPONENTS],
dupekey[MAX_STRING],
vw,
paintjob,
nitro,
hydros,
}
new Vehicles[][veh] = {
Код:
new vid = GetPlayerVehicleID(playerid);
if(dialogid == 158 && response == 1)
{
switch(listitem)
{
case 0:
{
dini_Set(CarFile(GetPlayerVehicleID(playerid)), "nitro", "1");
AddVehicleComponent(vid, 1010);
SendClientInfo(playerid, "Nitro added to your vehicle!");
GivePlayerMoneyEx(playerid,-300);
return 1;
}
case 1:
{
dini_Set(CarFile(GetPlayerVehicleID(playerid)), "hydros", "1");
AddVehicleComponent(vid, 1087);
SendClientInfo(playerid, "Hydros added to your vehicle!");
GivePlayerMoneyEx(playerid,-350);
return 1;
}
}
}
Код:
dini_IntSet(CarFile(i), "nitro", Vehicles[i][nitro]); dini_IntSet(CarFile(i), "hydros", Vehicles[i][hydros]);
Код:
Vehicles[i][nitro] = dini_Int(CarFile(i), "nitro"); Vehicles[i][hydros] = dini_Int(CarFile(i), "hydros");
Код:
if(Vehicles[vehicleid][nitro] > 0)
{
AddVehicleComponent(vid, 1010); // Nitro
return 1;
}
if(Vehicles[vehicleid][hydros] > 0)
{
AddVehicleComponent(vid, 1087); // Hydros
return 1;
}

