Bugged kick-from-vehicle script.
#2

1. How many cop cars will there be?

Код:
new copcars[0];
2. Which car is a cop car? However many lines of code there are with "copcars[?]", is your number of vehicles for number 1.

Код:
copcars[0] = AddStaticVehicle(...)
3. How do you define what is a cop car?

Код:
stock IsCopCar(vehicleid)
{
	for(new i=0; i<sizeof(copcars); i++)
	{
	  if(copcars[i] == vehicleid) return 1;
	}
	return 0;
}
4.

Код:
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER && IsCopCar(GetPlayerVehicleID(playerid)))
{
SendClientMessage(playerid,0xF08080AA,"You have been ejected.");
RemovePlayerFromVehicle(playerid);
return 1;
}
Tried and tested, any more issues feel free to reply.

Reply


Messages In This Thread
Bugged kick-from-vehicle script. - by IcyBlight - 12.05.2010, 17:49
Re: Bugged kick-from-vehicle script. - by Moglizorz. - 12.05.2010, 19:57
Re: Bugged kick-from-vehicle script. - by IcyBlight - 12.05.2010, 20:44

Forum Jump:


Users browsing this thread: 1 Guest(s)