DakiLLa Posted May 1, 2009 Share Posted May 1, 2009 (edited) hi. i'm trying to do something in nightlys and i have one question. Simple script with 'onMarkerHit' event: gResRoot = getResourceRootElement( getThisResource() ); addEventHandler( "onResourceStart", gResRoot, function () idlewood = createMarker( 2073.9887, -1831.4984, 13.5468, "cylinder", 2.5, 0, 255, 0, 50 ); addEventHandler( "onMarkerHit", idlewood, function ( player ) local vehicle = getPedOccupiedVehicle( player ); if vehicle then if isGarageOpen( 8 ) == false then setGarageOpen( 8, true ); else setGarageOpen( 8, false ); end end end ) end ) when i'm hitting the marker im getting a warning 'bad ped pointer' in line getPedOccupiedVehicle( player );. There were not errors like this one in dp-s.. so, whats my mistake? Edited May 1, 2009 by Guest Link to comment
Gamesnert Posted May 1, 2009 Share Posted May 1, 2009 For as far as I know onMarkerHit works with players and vehicles. Try checking what element hit the marker, and outputting that. I guess you should see that the vehicle triggered the event. Link to comment
DakiLLa Posted May 1, 2009 Author Share Posted May 1, 2009 ah ye, forgot to put getElementType there.. thx for help. But strange, in dp-s i didnt write checks on element type... and it worked fine.. but anyway thx 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