Jump to content

enter in car


botshara

Recommended Posts

Where is the problem ? I dont get message this police car.... and i can eneter in car :(

addEventHandler( "onVehicleStartEnter", root, 
    function( player, seat ) 
    local id = getElementModel ( theVehicle ) 
        if seat == 0 and id == 596 then 
            outputChatBox( "(( This is police car, you cant drive with it!. ))", player, 255, 0, 0 ) 
            cancelEvent( ) 
        end 
    end 
) 

Link to comment

thanks, another problem how to not equal on line 5 ?

  
addEventHandler( "onVehicleStartEnter", root, 
    function( player, seat ) 
    local id = getElementModel ( source ) 
        if seat == 0 and id == 596 and exports.factions:isPlayerInFaction( player, ~=1 ) then 
            outputChatBox( "(( This is police car, you cant drive with it!. . ))", player, 255, 0, 0 ) 
            cancelEvent( ) 
        end 
    end 
) 
  

  
and exports.factions:isPlayerInFaction( player, ~=1 ) 
  

Edited by Guest
Link to comment

isPlayerInFaction returns a value, if you would play 'not' infront of the exports.factions: it would automaticly see that as a flipped value ( true to false, false to true. )

if ( ( seat == 0 ) and ( id == 596 ) and not ( exports.factions:isPlayerInFaction ( player, 1 ) ) then 

Link to comment

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...