Jump to content

help again


golanu21

Recommended Posts

local x, y, z = 1361.099609375, -1658.7998046875, 12.39999961853 
fixmark = createMarker ( x, y, z, "cylinder", 3, 0, 255, 0, 255 ) 
function fixveh ( thePlayer )  
local theVehicle = getPedOccupiedVehicle (thePlayer) 
money = getPlayerMoney ( thePlayer ) 
if (money) > 4999 then 
fixVehicle ( theVehicle ) 
takePlayerMoney ( thePlayer, 5000 ) 
end 
end 
addEventHandler ( "onMarkerHit", fixmark, fixveh ) 

not work. no errors .. nothing

Link to comment
local x, y, z = 1361.099609375, -1658.7998046875, 12.39999961853 
fixmark = createMarker ( x, y, z, "cylinder", 3, 0, 255, 0, 255 ) 
  
function fixveh ( hitElement) 
    if getElementType(hitElement) == "vehicle" then 
     local thePlayer= getVehicleOccupant(hitElement) 
        local money = getPlayerMoney ( thePlayer ) 
        if (money) >= 5000 then 
        fixVehicle ( hitElement) 
        takePlayerMoney ( thePlayer, 5000 ) 
        end 
    end 
end 
addEventHandler ( "onMarkerHit", fixmark, fixveh ) 

Edited by Guest
Link to comment
local x, y, z = 1361.099609375, -1658.7998046875, 12.39999961853 
fixmark = createMarker ( x, y, z, "cylinder", 3, 0, 255, 0, 255 ) 
addEventHandler ( 
    'onMarkerHit', fixmark, 
    function ( hitElement ) 
        if (getElementType( hitElement ) == 'player' ) and getPedOccupiedVehicle( hitElement ) and getPlayerMoney( hitElement  >=5000) then 
        takePlayerMoney( hitElement, 5000) 
        fixVehicle(getPedOccupiedVehicle(hitElement)) 
        outputChatBox('** Vehicle Fixed **', hitElement, 255, 255, 0) 
    end 
end 
) 

Link to comment
blazy Code should work.

+1

But, If it wasn't working with you, Try this :

local x, y, z = 1361.099609375, -1658.7998046875, 12.39999961853 
fixmark = createMarker ( x, y, z, "cylinder", 3, 0, 255, 0, 255 ) 
  
function fixveh ( hitElement) 
    if getElementType(hitElement) == "vehicle" then 
     local thePlayer= getVehicleOccupant(hitElement) 
        local money = getPlayerMoney ( thePlayer ) 
        if (money) >= 5000 then 
        setElementHealth ( hitElement, 1000 ) 
        takePlayerMoney ( thePlayer, 5000 ) 
        end 
    end 
end 
addEventHandler ( "onMarkerHit", fixmark, fixveh ) 

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