Team Car Jack
#10

Quote:

I am not sure if you can stop them from car jacking

Of course you can stop them.

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(newstate == PLAYER_STATE_DRIVER)
	{
		new vehicleid = GetPlayerVehicleID(playerid);

		for(new i = 0; i < MAX_PLAYERS; i++)
		{
		  if(gTeam[i] == gTeam[playerid])
		  {
		  	SetVehicleParamsForPlayer(vehicleid, i, 0, 1); //locks the car for anyone on the team of the player entering the car.
			}
		}
	}
	else if(newstate == PLAYER_STATE_EXIT_VEHICLE)
	{
		new vehicleid = GetPlayerVehicleID(playerid);

		for(new i = 0; i < MAX_PLAYERS; i++)
		{
		  if(gTeam[i] == gTeam[playerid])
		  {
		  	SetVehicleParamsForPlayer(vehicleid, i, 0, 0);//unlocks the car for anyone on the team of the player entering the car.
			}
		}
	}
	return 1;
}
I'm not 100% sure that

Код:
new vehicleid = GetPlayerVehicleID(playerid);
will work if the newstate of the player is exitting his vehicle but try it...
Reply


Messages In This Thread
Team Car Jack - by MidoTheHawk - 04.06.2009, 17:41
Re: Team Car Jack - by hoodline - 04.06.2009, 18:20
Re: Team Car Jack - by samgreen - 04.06.2009, 19:19
Re: Team Car Jack - by MidoTheHawk - 05.06.2009, 00:00
Re: Team Car Jack - by efeX - 05.06.2009, 00:17
Re: Team Car Jack - by BMUK - 05.06.2009, 00:29
Re: Team Car Jack - by efeX - 05.06.2009, 00:31
Re: Team Car Jack - by samgreen - 05.06.2009, 06:31
Re: Team Car Jack - by BMUK - 05.06.2009, 11:03
Re: Team Car Jack - by lol2112 - 05.06.2009, 12:31

Forum Jump:


Users browsing this thread: 1 Guest(s)