31.05.2009, 04:40
you need a variable for cars like..
and you do isFactionVehicle[vehicleid] = 1; // do this when you add the vehicle. example:
now all that is left is do a check.
of course you may set the value isFactionVehicle to the id of the team/faction and check if player's team is equa to the faction and if that's the case don't remove him. uh... you should do it that way. this is just an example
USE SEARCH, B****!!
pawn Код:
new isFactionVehilce[701]; // 701 and id 0 won't be used
pawn Код:
/*OnGameModeInit*/
new car = CreateVehicle(/*parameters here*/);
isFactionVehicle[car] = 1;
pawn Код:
/*OnPlayerStateChange*/
if(newstate == PLAYER_STATE_DRIVER)
{
if(isFactionVehicle[GetPlayerVehicleID(playerid)])
{
SendClientMessage(playerid, 0xFFFFFFFF/*or any other color*/, "You may not drive this vehicle!");
RemovePlayerFromVehicle(playerid);
}
}
USE SEARCH, B****!!