SA-MP Forums Archive
Vehicle entering 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: Vehicle entering help (/showthread.php?tid=450426)



Vehicle entering help - siemka321 - 13.07.2013

My problem is that when I enter the vehicle, nothing happens. Here's my code:


Код:
new nuomojamasmoto;
Код:
nuomojamasmoto = AddStaticVehicle(462,1598.0696,-2296.6885,13.1331,180.9926,1,1); // nuomojamas moto
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    if(newstate == PLAYER_STATE_DRIVER && vehicleid == nuomojamasmoto)
    {
	ShowPlayerDialog(playerid,7,DIALOG_STYLE_MSGBOX,"Nuomotis","Ar norite iрsinuomoti рiа transporto priemonж uю $20?","Taip","Ne");
    }
    return 1;
}
It's supposed to show a dialog when I enter that specific vehicle, but nothing happens. Anyone knows the problem? Do I have to use the vehicle's ID instead of the one I applied?


Re: Vehicle entering help - siemka321 - 13.07.2013

Anyone?


Re: Vehicle entering help - JetForever - 13.07.2013

Use OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) calback