Problem with switching vehicle.
#1

I tried to create a feature for VIP's where they can switch between their two vehicles, it shows the dialog and i couldnt make the response of the dialog veh is vehicle no 1 and vveh is vehicle number 2.Suppose i have a sultan and bullet and i am at san fierro with my sultan and i want to get my bullet at my place and respawn the sultan so how do it do it.Codes are given below.They dont work however compiles perfectly.
pawn Код:
else if(dialogid == 30)
    {
        if(response)
        {
            new carid, Veh, VVeh;
            if(!PlayerInfo[playerid][VVeh]) return SendClientMessage(playerid, COLOR_GREY, "You only have one car, cant switch to others unless you own two cars.");
           
            if(carid == Veh)
            {
                new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
                SetVehiclePos(pVeh, pos[0], pos[1], pos[2]);
                LinkVehicleToInterior(veh, GetPlayerInterior(playerid));
            }
            else if(carid == VVeh)
            {
                new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
                SetVehiclePos(pVVeh, pos[0], pos[1], pos[2]);
                LinkVehicleToInterior(veh, GetPlayerInterior(playerid));
            }
        }
    }
Reply
#2

Help please?
Reply
#3

BUMP
Reply
#4

BUMP!
Reply
#5

I don't see anything that defines veh and vveh?
Reply
#6

Yea its not but can you fix it i just added that to show example, i mean vveh is for vips who can have 2nd car and veh is just normal.
Reply
#7

The compiler doesn't know what is 'carid'
You need to link it to something.
carid = getvehiclemodel or stuff?
otherwise how can it work?
Reply
#8

Also, you don't need to use ' else if ' for getting dialog id.

pawn Код:
else if(dialogid == 30) //This is wrong
that's why you are not getting any response.

change it to
pawn Код:
if(dialogid == 30)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)