Jump to content

Vehicle seats


ViRuZGamiing

Recommended Posts

Posted

Hi,

This is my code

policeVehicles = { [598]=true, [596]=true, [597]=true, [599]=true, [427]=true, [525]=true, [523]=true } 
policeSkins = { [280]=true, [281]=true, [282]=true, [283]=true, [284]=true, [285]=true, [286]=true } 
  
function enterVehicle ( thePlayer, seat, jacked ) 
    if ( policeVehicles[getElementModel ( source )] ) and ( not policeSkins[getElementModel ( thePlayer )] ) then 
        removePedFromVehicle ( thePlayer )  
        outputChatBox ( "Access Denied, employees only!", thePlayer ) 
    end 
end 
addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) 

I'm assuming that i would be kicked out of the car too when I'm in the backseat,

How can I set only removePedFromVehicle on Driver seat?

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted

Fixed it myself, sry

policeVehicles = { [598]=true, [596]=true, [597]=true, [599]=true, [427]=true, [525]=true, [523]=true } 
policeSkins = { [280]=true, [281]=true, [282]=true, [283]=true, [284]=true, [285]=true, [286]=true } 
  
function enterVehicle ( thePlayer, seat, jacked ) 
    if ( policeVehicles[getElementModel ( source )] ) and ( not policeSkins[getElementModel ( thePlayer )] ) and  ( getPedOccupiedVehicleSeat (thePlayer) == 0) then 
        removePedFromVehicle ( thePlayer )  
        outputChatBox ( "Access Denied, employees only!", thePlayer ) 
    end 
end 
addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) 

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...