Jump to content

Bad 'ped' pointers?


[DKR]Jake

Recommended Posts

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

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