• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CMD:buycar replaces 2 slot owned car not adds it to 3 slot
#1
Hey guys, i´m sure the solution is easy but i cant see the mistake here atm. So if you can help me i would really appricieate it. So the problem is that every player can own up to 3 vehicles. but when ever i try to buy the third one it wount add it to 3 slot it will replace the second slot car like if i have a Sultan and a Bullet and i want to buy sabre it will replace bullet with sabre. Here is the code im using:
Code:
if(price > PlayerInfo[playerid][pMoney]) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money on you.");
            GiveZaiatMoney(playerid, -price);
             format(string, sizeof(string), " You have purchased a %s. (Unlock it using /lock)", RVN(carid));
            SendClientMessage(playerid, COLOR_GREEN, string);
            if(PlayerInfo[playerid][vModel])
            {
                PlayerInfo[playerid][pVVeh] = CreateVehicle(carid, -290.5945, 1312.6644, 54.2423, 82.0000, 0, 0,32000);
                SetVehicleParamsEx(PlayerInfo[playerid][pVVeh], 0, 0, 0, 1, 0, 0, 0);
                PlayerInfo[playerid][vVLocked] = 1;
                PlayerInfo[playerid][vVModel] = carid;
                GetVehiclePos(PlayerInfo[playerid][pVVeh], PlayerInfo[playerid][vVX], PlayerInfo[playerid][vVY], PlayerInfo[playerid][vVZ]);
                GetVehicleZAngle(PlayerInfo[playerid][pVVeh], PlayerInfo[playerid][vVA]);
                PlayerInfo[playerid][vVC1] = 0;
                PlayerInfo[playerid][vVC2] = 0;
                return 1;
            }
            else if(PlayerInfo[playerid][vVModel])
            {
                PlayerInfo[playerid][pVVVeh] = CreateVehicle(carid, -290.5945, 1312.6644, 54.2423, 82.0000, 0, 0,32000);
                SetVehicleParamsEx(PlayerInfo[playerid][pVVVeh], 0, 0, 0, 1, 0, 0, 0);
                PlayerInfo[playerid][vVVLocked] = 1;
                PlayerInfo[playerid][vVVModel] = carid;
                GetVehiclePos(PlayerInfo[playerid][pVVVeh], PlayerInfo[playerid][vVVX], PlayerInfo[playerid][vVVY], PlayerInfo[playerid][vVVZ]);
                GetVehicleZAngle(PlayerInfo[playerid][pVVVeh], PlayerInfo[playerid][vVVA]);
                PlayerInfo[playerid][vVVC1] = 0;
                PlayerInfo[playerid][vVVC2] = 0;
                return 1;
            }
            PlayerInfo[playerid][pVeh] = CreateVehicle(carid, -290.5945, 1312.6644, 54.2423, 82.0000, 0, 0,32000);
            SetVehicleParamsEx(PlayerInfo[playerid][pVeh], 0, 0, 0, 1, 0, 0, 0);
            PlayerInfo[playerid][vLocked] = 1;
            PlayerInfo[playerid][vModel] = carid;
            GetVehiclePos(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][vX], PlayerInfo[playerid][vY], PlayerInfo[playerid][vZ]);
            GetVehicleZAngle(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][vA]);
            PlayerInfo[playerid][vC1] = 0;
            PlayerInfo[playerid][vC2] = 0;
            
        }
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)