[DKR]Jake Posted August 23, 2011 Share Posted August 23, 2011 I have an issue. I made a working script for pay&spray, however I keep getting these two warnings whenver I enter the marker to repair. Bad 'ped' pointer @ 'getPedOccupiedVehicle' (1)Bad 'ped' pointer @ 'isPedInVehicle' (1) Yet, the script still functions fine? Here's the block of code where those two are included: function repairVehicle( hitElement ) local vehicle = getPedOccupiedVehicle( hitElement ) if isPedInVehicle( hitElement ) == true then fixVehicle( vehicle ) playSoundFrontEnd( hitElement, 46 ) outputChatBox( "Your vehicle has been repaired - enjoy!", hitElement, 0, 255, 0, true ) else outputChatBox( "You need to be in a vehicle!", hitElement, 255, 0, 0, true ) end end addEventHandler( "onMarkerHit", repair, repairVehicle ) -- Repair Vehicle Help would be appreciated thanks Link to comment
eAi Posted August 23, 2011 Share Posted August 23, 2011 hitElement isn't a ped, it's probably a vehicle. Link to comment
bandi94 Posted August 23, 2011 Share Posted August 23, 2011 function repairVehicle( hitElement ) if getElementType ( hitElement ) == "Player" then local vehicle = getPedOccupiedVehicle( hitElement ) if vehicle then fixVehicle( vehicle ) playSoundFrontEnd( hitElement, 46 ) outputChatBox( "Your vehicle has been repaired - enjoy!", hitElement, 0, 255, 0, true ) elseif getElementType ( hitElement ) == "Vehicle" then if getVehicleOccupant ( hitElement ) then fixVehicle( hitElement ) playSoundFrontEnd( hitElement, 46 ) outputChatBox( "Your vehicle has been repaired - enjoy!", hitElement, 0, 255, 0, true ) end else outputChatBox( "You need to be in a vehicle!", hitElement, 255, 0, 0, true ) end end end addEventHandler( "onMarkerHit", repair, repairVehicle ) try this not tested 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