SA-MP Forums Archive
[HELP]OnPlayerEnterVehicle Not working properly - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]OnPlayerEnterVehicle Not working properly (/showthread.php?tid=152935)



[HELP]OnPlayerEnterVehicle Not working properly - Lilcuete - 06.06.2010

Well OnPlayerEntervehicle is working but not with my code it is supposed to not let them in the vehicles if there not a donator.For donator rank 1 is supposed to let them in if there a donator lvl 1 but if not it is supposed to not let them enter it but it doesnt work :S
Код:
	if (GetVehicleModel(vehicleid) == 481 && !ispassenger)
		{
		  if(PlayerInfo[playerid][pDonateRank]== 1) 
			 {

				SendClientMessage(playerid,COLOR_LIGHTRED," Warning:You don't have permission to ride this (Need to be a donator)");
				new Float:cx, Float:cy, Float:cz;
				GetPlayerPos(playerid, cx, cy, cz);
				SetPlayerPos(playerid, cx, cy, cz);
			}
	 }
	 if (GetVehicleModel(vehicleid) == 468 || GetVehicleModel(vehicleid)== 541 || GetVehicleModel(vehicleid)== 521 && !ispassenger)
		{
		  if(PlayerInfo[playerid][pDonateRank]== 2)
			 {

				SendClientMessage(playerid,COLOR_LIGHTRED," Warning:You don't have permission to ride this (Need to be a donator Gold Membership)");
				new Float:cx, Float:cy, Float:cz;
				GetPlayerPos(playerid, cx, cy, cz);
				SetPlayerPos(playerid, cx, cy, cz);
			}
	 }



Re: [HELP]OnPlayerEnterVehicle Not working properly - Lilcuete - 06.06.2010

Sorry for bumping to early but can someone please help me fix this


Re: [HELP]OnPlayerEnterVehicle Not working properly - Lilcuete - 17.06.2010

Please reply


Re: [HELP]OnPlayerEnterVehicle Not working properly - zombie13333 - 17.06.2010

I don't think that will do anything. Ineffective script. Because it most likely detects the vehicle when he is in it. And it resets the position back in the vehicle.
Код:
RemovePlayerFromVehicle(i)
Try having it remove the player from the vehicle when he enters it instead.