02.01.2012, 14:52
You can reset the weapons of the player if he's a driver, and set the weapons back when he gets out of the vehicle.
Example (GivePlayerWeapons(playerid) is a custom function you would need to write):
Example (GivePlayerWeapons(playerid) is a custom function you would need to write):
pawn Код:
new bool:RestrictedDriveBy[MAX_PLAYERS]; // On topof script
public OnPlayerEnterVehicle(playerid, vehicleid) {
// Check if the player is the driver
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
ResetPlayerWeapons(playerid); // Reset his weapons
RestrictedDriveBy[playerid] = true;
}
}
public OnPlayerExitVehicle(playerid, vehicleid) {
if(RestrictedDriveBy[playerid] == true) {
GivePlayerWeapons(playerid); // Give him back his weapons (custom)
RestrictedDriveBy[playerid] = false;
}
}