04.01.2015, 01:55
Hello guys
i have a problem selling my car at the half of the real price problem is i dont get half of price i get random numbers but same car model, here is my code :
Vehicle shop enum:
Selling Checkpoint:
And this is confirmation :
i have a problem selling my car at the half of the real price problem is i dont get half of price i get random numbers but same car model, here is my code :
Vehicle shop enum:
PHP код:
enum ShopVehiclesData
{
VehicleModel,
VehicleID,
Price,
Float: vPos_X,
Float: vPos_Y,
Float: vPos_Z,
Float: vPos_A
};
new ShopVehicles[33][ShopVehiclesData] =
{
//{Vehicle Model, -1, Price, PosX, PosY, PosZ, PosA} <--- this is example
{411, -1, 50000, 561.0876,-1289.7925,16.9753,21.1978}, //Infernus
{429, -1, 23000, 557.0084,-1291.0620,16.9279,20.9678}, //Banshee
{451, -1, 20000, 552.8647,-1291.4087,16.9558,22.4345}, //Turismo
{541, -1, 25000, 548.1733,-1291.7915,16.8731,18.5864}, //Bullet
};
PHP код:
if(listitem == 2)
{
new vsellstring[128];
if(pInfo[playerid][pcar] ==0) return SendClientMessage(playerid,0xAA3333AA, "{F81414}[ Error ]: {FFFFFF}You dont own a car!");
format(vsellstring, sizeof(vsellstring), "You selling your %s price as %d !", VehicleNames2[GetVehicleModel(GetPlayerVehicleID(playerid)) - 400], ShopVehicles[ VehicleSelected[playerid]] ][Price]/2);
ShowPlayerDialog(playerid, DIALOG_CONFIRM_VEHICLE_SELL, DIALOG_STYLE_MSGBOX, "DealerShip", vsellstring, "Sell", "Cancel");
}
PHP код:
if(dialogid == DIALOG_CONFIRM_VEHICLE_SELL)
{
if(response)
{
SendClientMessage(playerid, GREEN, "{EE5555}[SERVERIS]{FFFFFF} Your sold your car");
GivePlayerMoney(playerid, ShopVehicles[ VehicleSelected[playerid] ][Price]/2);
RemovePlayerFromVehicle(playerid);
}
}