SA-MP Forums Archive
help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help (/showthread.php?tid=578177)



help - Rabea - 17.06.2015

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;
        }
    }
 }



Re: help - Darrenr - 17.06.2015

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


Re: help - Rabea - 17.06.2015

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;
        }
    }
 }



Re: help - Rabea - 18.06.2015

Bump


Re: help - Rabea - 18.06.2015

bump


Re: help - Ritzy2K - 18.06.2015

wait 24 hrs before bumping get used to the rules.


Re: help - Rabea - 19.06.2015

Bump!
Anyone could fix this?


Re: help - rappy93 - 19.06.2015

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

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



Re: help - Rabea - 23.06.2015

pVVeh is the second car