Jump to content

Question to Marker feat. Functions


Maurize

Recommended Posts

  
addEventHandler( "onMarkerHit", elementPlayer, 
function( hitPlayer ) 
if ( isPedInVehicle( hitPlayer ) == false ) then 
if ( source == clubMarker ) then 
    setElementInterior( hitPlayer, 2, 1204.9, -10.5, 1000.9 ) 
    triggerClientEvent( "onElementClub", hitPlayer ) 
    toggleControl( hitPlayer, "fire", false ) 
elseif ( source == clubMarker2 ) then 
    setElementInterior( hitPlayer, 0, 2421.5, -1223.9, 25.3 ) 
    triggerClientEvent( "onElementClub", hitPlayer ) 
    toggleControl( hitPlayer, "fire", true ) 
        end 
    end 
end ) 
  

bad pointer at isPedInVehicle.. any ideas?

Link to comment

try this

server side:

addEventHandler ("onMarkerHit", getRootElement(), 
function( hitPlayer ) 
if ( source == clubMarker ) then 
 if (getElementType(hitPlayer) == "vehicle") then 
    setElementInterior( hitPlayer, 2, 1204.9, -10.5, 1000.9 ) 
    triggerClientEvent( "onElementClub", hitPlayer ) 
    toggleControl( hitPlayer, "fire", false ) 
elseif ( source == clubMarker2 ) then 
    setElementInterior( hitPlayer, 0, 2421.5, -1223.9, 25.3 ) 
    triggerClientEvent( "onElementClub", hitPlayer ) 
    toggleControl( hitPlayer, "fire", true ) 
        end 
    end 
end 
) 

Link to comment
addEventHandler ( 'onMarkerHit', root, 
    function( uElement ) 
        if getElementType( uElement ) == 'player' and isPedInVehicle( uElement ) then 
            if source == clubMarker then 
                setElementInterior( getPedOccupiedVehicle( uElement ), 2, 1204.9, -10.5, 1000.9 ) 
                triggerClientEvent( 'onElementClub', uElement ) 
                toggleControl( uElement, 'fire', false ) 
            elseif source == clubMarker2 then 
                setElementInterior( uElement, 0, 2421.5, -1223.9, 25.3 ) 
                triggerClientEvent( 'onElementClub', uElement ) 
                toggleControl( uElement, 'fire', true ) 
            end 
        end 
    end 
) 

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