14.03.2013, 12:27
Bien esto es lo que he hecho para mi sistema de compra de autos pero no se por que no se guardan aca lo que e hecho:
Y el comando
Alguien sabe por que no me guardan?
pawn Код:
forward Cargarv();
public Cargarv()
{
new float:xp,float:yp,float:zp,float:z_angle;
new INI: file = INI_Open("Autos/Carros.cfg");
new idx = DESDE;
new playerid;
if (file)
{
AutoInfo[DESDE][Modelo] = GetPlayerVehicleID(playerid);
AutoInfo[DESDE][Posx] = xp;
AutoInfo[DESDE][Posy] = yp;
AutoInfo[DESDE][Posz] = zp;
}
return 1;
}
forward GuardarC();
public GuardarC()
{
new File: file3 = fopen("Autos/Carros.cfg", io_write);
new float:xp,float:yp,float:zp,float:z_angle;
new playerid;
new coordsstring[256];
new idx = DESDE;
if (file3)
{
format(coordsstring, sizeof(coordsstring), "%d,%f,%f,%f\n",
AutoInfo[DESDE][Modelo] = GetPlayerVehicleID(playerid),
AutoInfo[DESDE][Posx] = xp,
AutoInfo[DESDE][Posy] = yp,
AutoInfo[DESDE][Posz] = zp);
}
return Cargarv();
}
pawn Код:
zcmd(cv,playerid,params[])
{
DestroySelectionMenu(playerid);
SetPVarInt(playerid, "vspawner_active", 1);
//SetPVarInt(playerid, "vspawner_page", 0); // will reset the page back to the first
CreateSelectionMenu(playerid);
SelectTextDraw(playerid, 0xACCBF1FF);
return 1;
}
pawn Код:
SpawnVehicle_InfrontOfPlayer(playerid, vehiclemodel, color1, color2)
{
new Float:x,Float:y,Float:z;
new Float:facing;
new Float:distance;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, facing);
new Float:size_x,Float:size_y,Float:size_z;
GetVehicleModelInfo(vehiclemodel, VEHICLE_MODEL_INFO_SIZE, size_x, size_y, size_z);
distance = size_x + 0.5;
x += (distance * floatsin(-facing, degrees));
y += (distance * floatcos(-facing, degrees));
facing += 90.0;
if(facing > 360.0) facing -= 360.0;
CreateVehicle(vehiclemodel, x, y, z + (size_z * 0.25), facing, color1, color2, -1);
return GuardarC();
}