Problem with switching vehicle. - 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: Problem with switching vehicle. (
/showthread.php?tid=403935)
Problem with switching vehicle. -
Laure - 01.01.2013
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));
}
}
}
Re: Problem with switching vehicle. -
Laure - 01.01.2013
Help please?
Re: Problem with switching vehicle. -
Laure - 01.01.2013
BUMP
Re: Problem with switching vehicle. -
Laure - 02.01.2013
BUMP!
Re: Problem with switching vehicle. -
Christoffer - 02.01.2013
I don't see anything that defines veh and vveh?
Re: Problem with switching vehicle. -
Laure - 02.01.2013
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.
Re: Problem with switching vehicle. -
[HK]Ryder[AN] - 02.01.2013
The compiler doesn't know what is 'carid'
You need to link it to something.
carid = getvehiclemodel or stuff?
otherwise how can it work?
Re: Problem with switching vehicle. - Jarnu - 02.01.2013
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