SA-MP Forums Archive
Preventing team from entering vehicles? - 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: Preventing team from entering vehicles? (/showthread.php?tid=331028)



Preventing team from entering vehicles? - daac - 03.04.2012

I'm trying to make a specific team in-able of entering a vehicle. *Its a zombie class*
Is there anyway to code this?
Thanks


Re: Preventing team from entering vehicles? - blank. - 03.04.2012

Код:
public OnPlayerEnterVehicle(playerid,vehicleid)
	{
	if(Team[playerid] == TEAM_ZOMBIE) // Change this to how you deal with teams in your script
		{
		RemovePlayerFromVehicle(playerid);
		}
	}
This method is better if you ask me since OnPlayerEnterVehicle isn't called when you place a player in a vehicle for instance.
Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
	{
	if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
		Ѓ{
		if(Team[playerid] == TEAM_ZOMBIE) // Change this to how you deal with teams in your script
			{
			RemovePlayerFromVehicle(playerid);
			}
		}
	}



Re: Preventing team from entering vehicles? - MP2 - 03.04.2012

Lock the doors with SetVehicleParamsForPlayer?


Re: Preventing team from entering vehicles? - daac - 03.04.2012

Thanks
Works great!