#1

what is wrong with that code, it won't create third vehicle. #pBVeh
pawn Код:
if(PlayerInfo[playerid][pVeh])
            {
                PlayerInfo[playerid][pVVeh] = CreateVehicle(carid, 532.3726,-1287.4926,17.2422,272.3125,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;
            }
            if(!PlayerInfo[playerid][pVeh])
            {
                PlayerInfo[playerid][pVeh] = CreateVehicle(carid, 532.3726,-1287.4926,17.2422,272.3125,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;
                return 1;
            }
            if(PlayerInfo[playerid][pVVeh])
            {
            PlayerInfo[playerid][pBVeh] = CreateVehicle(carid, 532.3726,-1287.4926,17.2422,272.3125,0,0,32000);
            SetVehicleParamsEx(PlayerInfo[playerid][pBVeh], 0, 0, 0, 1, 0, 0, 0);
            PlayerInfo[playerid][vBLocked] = 1;
            PlayerInfo[playerid][vBModel] = carid;
            GetVehiclePos(PlayerInfo[playerid][pBVeh], PlayerInfo[playerid][vBX], PlayerInfo[playerid][vBY], PlayerInfo[playerid][vBZ]);
            GetVehicleZAngle(PlayerInfo[playerid][pBVeh], PlayerInfo[playerid][vBA]);
            PlayerInfo[playerid][vBC1] = 0;
            PlayerInfo[playerid][vBC2] = 0;
            return 1;
        }
    }
 }
Reply
#2

care to show us all of the code that leads to this code being run?
Reply
#3

pawn Код:
else if(dialogid == 11) // Bikes
    {
        new string[128], carid, price;
        if(response)
        {
            switch(listitem)
            {
                case 0: {carid = 481; price = 20000;} // BMX
                case 1: {carid = 462; price = 35000;} // FAGGIO
                case 2: {carid = 463; price = 60000;} // FREEWAY
                case 3: {carid = 468; price = 70000;} // SANCHEZ
                case 4: {carid = 471; price = 20000;} // QUAD
                case 5: {carid = 461; price = 100000;} // PCJ-600
                case 6: {carid = 521; price = 150000;} // FCR-900
                case 7: {carid = 522; price = 250000;}
            }
            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][pVeh])
            {
                PlayerInfo[playerid][pVVeh] = CreateVehicle(carid, 532.3726,-1287.4926,17.2422,272.3125,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;
            }
            if(!PlayerInfo[playerid][pVeh])
            {
                PlayerInfo[playerid][pVeh] = CreateVehicle(carid, 532.3726,-1287.4926,17.2422,272.3125,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;
                return 1;
            }
            if(PlayerInfo[playerid][pVVeh])
            {
            PlayerInfo[playerid][pBVeh] = CreateVehicle(carid, 532.3726,-1287.4926,17.2422,272.3125,0,0,32000);
            SetVehicleParamsEx(PlayerInfo[playerid][pBVeh], 0, 0, 0, 1, 0, 0, 0);
            PlayerInfo[playerid][vBLocked] = 1;
            PlayerInfo[playerid][vBModel] = carid;
            GetVehiclePos(PlayerInfo[playerid][pBVeh], PlayerInfo[playerid][vBX], PlayerInfo[playerid][vBY], PlayerInfo[playerid][vBZ]);
            GetVehicleZAngle(PlayerInfo[playerid][pBVeh], PlayerInfo[playerid][vBA]);
            PlayerInfo[playerid][vBC1] = 0;
            PlayerInfo[playerid][vBC2] = 0;
            return 1;
        }
    }
 }
Reply
#4

Bump
Reply
#5

bump
Reply
#6

wait 24 hrs before bumping get used to the rules.
Reply
#7

Bump!
Anyone could fix this?
Reply
#8

Is the text in red meant to be like that ? With 2 V ?

Код:
if(PlayerInfo[playerid][pVVeh])
Reply
#9

pVVeh is the second car
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)