Entering Vehicle Will not work - 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: Entering Vehicle Will not work (
/showthread.php?tid=349204)
Entering Vehicle Will not work -
Infinity90 - 08.06.2012
Fix this please, i will +Rep
pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new string[128];
if(vehicleid == 520 || vehicleid == 425 || vehicleid == 447 || vehicleid == 432)
{
new Float:slx, Float:sly, Float:slz;
GetPlayerPos(playerid, slx, sly, slz);
RemovePlayerFromVehicle(playerid);
SetPlayerPos(playerid, slx, sly, slz+1.5);
PlayerPlaySound(playerid, 1130, slx, sly, slz+1.3);
format(string,sizeof(string),"You are not allowed inside this vehicle!");
SendClientMessage(playerid,green,string);
}
return 1;
}
I'm trying to kick them out the vehicle when the player goes in any of the vehicle Id's listed above and nothing happens, can someone fix it for me please.
Re: Entering Vehicle Will not work -
Konstantinos - 08.06.2012
Use on
OnPlayerStateChange
Re: Entering Vehicle Will not work -
Infinity90 - 08.06.2012
I was going to try that but my code should work right?
Re: Entering Vehicle Will not work -
JaKe Elite - 08.06.2012
use OnPlayerStateChange then check if player's newstate is PLAYER_STATE_DRIVER
hmm... not sure maybe it work
Re: Entering Vehicle Will not work -
Vince - 08.06.2012
https://sampwiki.blast.hk/wiki/GetVehicleModel