Maurize Posted March 27, 2012 Share Posted March 27, 2012 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
sckatchof Posted March 27, 2012 Share Posted March 27, 2012 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
Kenix Posted March 28, 2012 Share Posted March 28, 2012 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
Maurize Posted March 30, 2012 Author Share Posted March 30, 2012 wow nice.. & 1 other question: what is the default dimension? I mean i've setted the elements dimension to 100.. hows the default of each other? Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now