06.08.2014, 04:00
Eh aсadido un sistema de mecбnicos /llantas el cual le coloca el auto las ruedas.. bueno ,tengo el siguiente problema no me guarda el tuneado de las ruedas ,acб les paso la funcion de colocar la rueda por click.
Miren aca.. es el sistema de guardado de tuning de vehiculos
Como harнa para guardar, el tuneado de las ruedas?
pawn Код:
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
if(listid == MenuLlantas)
{
if(response)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid == 0)return 1;
new carmodelid, string[80];
carmodelid = GetVehicleModel(vehicleid);
string = GetWheelName(modelid);
AddVehicleComponent(vehicleid, modelid); // Miren aca aсade el componente pero ,mas no lo guarda en el ini
vMods[VehVenta_ID(vehicleid)][playerid] = string;
format(string, sizeof(string), "<!> {ffffff}Cambiaste las llantas del %s[%d] por unas %s.", TituloVehiculo[carmodelid-400], carmodelid, string);
SendClientMessage(playerid, C_VERDE, string);
}
else
{
SendClientMessage(playerid, C_ROJO, "<!> {ffffff}Cancelado.");
}
return 1;
}
return 1;
}
pawn Код:
// ------=========[ Sistema de vehнculos ]============--------- //
stock ActualizarVehiculo(iVehicleID)
{
new iStr[22];
format(iStr, sizeof(iStr), "Vehiculos/%d.ini", iVehicleID);
new INI:VArch = INI_Open(iStr);
INI_SetTag(VArch,"data");
INI_WriteInt(VArch,"Modelo", InfoVeh[iVehicleID][vModelo]);
INI_WriteInt(VArch,"Color1", InfoVeh[iVehicleID][vColor1]);
INI_WriteInt(VArch,"Color2", InfoVeh[iVehicleID][vColor2]);
INI_WriteInt(VArch,"Precio", InfoVeh[iVehicleID][vPrecio]);
INI_WriteString(VArch,"Dueсo", InfoVeh[iVehicleID][vComprador]);
INI_WriteFloat(VArch,"vPosX", InfoVeh[iVehicleID][vPosX]);
INI_WriteFloat(VArch,"vPosY", InfoVeh[iVehicleID][vPosY]);
INI_WriteFloat(VArch,"vPosZ", InfoVeh[iVehicleID][vPosZ]);
INI_WriteFloat(VArch,"vPosA", InfoVeh[iVehicleID][vPosA]);
INI_WriteString(VArch,"Placa", InfoVeh[iVehicleID][vPlaca]);
INI_WriteInt(VArch,"PaintJ", InfoVeh[iVehicleID][vPintadoJ]);
// Guardar TUNING
INI_WriteInt(VArch,"vMod1", vMods[iVehicleID][0]);
INI_WriteInt(VArch,"vMod2", vMods[iVehicleID][1]);
INI_WriteInt(VArch,"vMod3", vMods[iVehicleID][2]);
INI_WriteInt(VArch,"vMod4", vMods[iVehicleID][3]);
INI_WriteInt(VArch,"vMod5", vMods[iVehicleID][4]);
INI_WriteInt(VArch,"vMod6", vMods[iVehicleID][5]);
INI_WriteInt(VArch,"vMod7", vMods[iVehicleID][6]);
INI_WriteInt(VArch,"vMod8", vMods[iVehicleID][7]);
INI_WriteInt(VArch,"vMod9", vMods[iVehicleID][8]);
INI_WriteInt(VArch,"vMod10", vMods[iVehicleID][9]);
INI_WriteInt(VArch,"vMod11", vMods[iVehicleID][10]);
INI_WriteInt(VArch,"vMod12", vMods[iVehicleID][11]);
INI_WriteBool(VArch,"Usado", InfoVeh[iVehicleID][vUsado]);
INI_WriteInt(VArch,"Cerrado", InfoVeh[iVehicleID][vCerrado]);
INI_WriteInt(VArch,"Familia", InfoVeh[iVehicleID][vFamilia]);
INI_WriteInt(VArch,"Interior", InfoVeh[iVehicleID][vInt]);
INI_WriteInt(VArch,"VirtualWorld", InfoVeh[iVehicleID][vVW]);
INI_Close(VArch);
return 1;
}
funcion CargarVehiculo_data(i,name[],value[])
{
INI_Int("Modelo",InfoVeh[i][vModelo]);
INI_Int("Color1",InfoVeh[i][vColor1]);
INI_Int("Color2",InfoVeh[i][vColor2]);
INI_Int("Precio",InfoVeh[i][vPrecio]);
INI_String("Dueсo",InfoVeh[i][vComprador],MAX_PLAYER_NAME);
INI_Float("vPosX",InfoVeh[i][vPosX]);
INI_Float("vPosY",InfoVeh[i][vPosY]);
INI_Float("vPosZ",InfoVeh[i][vPosZ]);
INI_Float("vPosA",InfoVeh[i][vPosA]);
INI_String("Placa",InfoVeh[i][vPlaca],MAX_PLAYER_NAME);
INI_Int("PaintJ",InfoVeh[i][vPintadoJ]);
INI_Bool("Cerrado",InfoVeh[i][vCerrado]);
INI_Bool("Usado",InfoVeh[i][vUsado]);
INI_Int("Familia",InfoVeh[i][vFamilia]);
INI_Int("Interior",InfoVeh[i][vInt]);
INI_Int("VirtualWorld",InfoVeh[i][vVW]);
//mods
INI_Int("vMod1",vMods[i][0]);
INI_Int("vMod2",vMods[i][1]);
INI_Int("vMod3",vMods[i][2]);
INI_Int("vMod4",vMods[i][3]);
INI_Int("vMod5",vMods[i][4]);
INI_Int("vMod6",vMods[i][5]);
INI_Int("vMod7",vMods[i][6]);
INI_Int("vMod8",vMods[i][7]);
INI_Int("vMod9",vMods[i][8]);
INI_Int("vMod10",vMods[i][9]);
INI_Int("vMod11",vMods[i][10]);
INI_Int("vMod12",vMods[i][11]);
return 1;
}
stock CargarVehiculos()
{
new VArch[18 *MAX_VEH_VENTA char],v;
print("\n______________________________________________________________________________\n");
print("\t\tCargando vehнculos ...\n");
while(v < MAX_VEH_VENTA)
{
format(VArch,sizeof(VArch),"Vehiculos/%d.ini",v);
if(fexist(VArch))
{
INI_ParseFile(VArch,"CargarVehiculo_%s",.bExtra = true, .extra = v);
new VehID = CreateVehicle(InfoVeh[v][vModelo], InfoVeh[v][vPosX], InfoVeh[v][vPosY], InfoVeh[v][vPosZ], InfoVeh[v][vPosA], InfoVeh[v][vColor1], InfoVeh[v][vColor2], 500000);
printf("Modelo: %i | Colores: %i , %i | Dueсo: %s | Usado: %i",InfoVeh[v][vModelo],InfoVeh[v][vColor1],InfoVeh[v][vColor2],InfoVeh[v][vComprador],InfoVeh[v][vCerrado],InfoVeh[v][vUsado]);
SetVehicleNumberPlate(VehID, InfoVeh[v][vPlaca]);
ChangeVehiclePaintjob(VehID, InfoVeh[v][vPintadoJ]);
SetVehicleVirtualWorld(VehID, InfoVeh[v][vVW]);
LinkVehicleToInterior(VehID,InfoVeh[v][vInt]);
Iter_Add(VehVenta,v);
VehVenta_ID(VehID) = v;
ID_VehOriginal[v] = VehID;
Total_Vehiculos_Creados++;
if(InfoVeh[v][vCerrado])
{
CerrarPuertas(VehID);
}
for(new iMod = 0; iMod < MAX_VEH_MODS; ++iMod)
{
if(vMods[VehVenta_ID(VehID)][iMod] > 0)
{
AddVehicleComponent(VehID, vMods[VehVenta_ID(VehID)][iMod]);
}
}
}
v++;
}
printf("\n- Cantidad de vehнculos cargados: %i\n",Total_Vehiculos_Creados);
}