Hey guys.
I have tryed to get this working all this morning.
Код:
public AddCar(model,Float:x,Float:y,Float:z,Float:angle,color1,color2,delay,objective,doorslocked,vehicletype,materials,crack,pot,load,capasity,health,alarm,owned,nitro,paintjob,hydro,pimped,perma,rank,price)
{
new FoundID = 0;
new ID;
new string[128];
if(model > 399 && model < 612)
{
for ( new i = 1; FoundID <= 0 ; i++)
{
format(string,sizeof(string),"vehicle/%i.ini",i);
if(!dini_Exists(string))
{
ID = i;
FoundID = 1;
}
if( i > MAX_DVEHICLES )
{
return true;
}
}
format(string,sizeof(string),"vehicle/%i.ini",ID);
dini_Create(string);
dini_IntSet(string, "Model", model);
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);
dini_IntSet(string, "VehicleType", vehicletype);
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_IntSet(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][cVehicleType] = vehicletype;
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;
SetVehicleNumberPlate(CarSystem[ID][cFileID], CarSystem[ID][cPrice]);
CarSystem[ID][cVehicleID] = CreateVehicle(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;
}
I want the plates to be integraded in my system, but it will not set my plates :/
You need the vehicle id, put it after CreateVehicle and use CarSystem[ID][cVehicleID] then respawn the car