Jump to content

[Help] Script Error


Recommended Posts

when i hit marker nothing happen...even no error..Check:

server side:

    local pbags = 
        { 
            { 2293.154296875, 561.470703125, 7.78125 }, 
        } 
        local marker = createMarker ( 2291.1999511719, 537, 0.80000001192093, "cylinder", 1.5, 255, 0, 0 ) 
    function createBags ( thePlayer ) 
        local x, y, z = unpack ( pbags [ math.random ( #pbags ) ] ) 
        local baga = createPickup ( x, y, z, 3, 1210 ) 
        addEventHandler ( "onPickupHit", baga, onPickupHit ) 
        addEventHandler ("onPlayerQuit", baga, onPlayerQuit) 
        addEventHandler ("onClientMarkerHit", marker, onMarkerHit)       
    end 
    addEventHandler ( "onResourceStart", getRootElement(), createBags ) 
      
    function onPickupHit ( thePlayer ) 
        if ( isPedInVehicle ( thePlayer ) ) then 
            return 
        end 
        if ( isPedDead ( thePlayer ) ) then 
            return 
        end 
        local bagb = createObject ( 1210, 0, 0, 0 ) 
        setElementData ( thePlayer, "baga", true ) 
        exports.bone_attach:attachElementToBone(bagb,thePlayer,12,0,0.1,0.3,0,180,0)         
    end 
function onMarkerHit () 
    triggerClientEvent (source, "OCMHjob", marker) 
    end 
function onPlayerQuit ( ) 
destroyElement ( baga ) 
if getElementData (source, "baga") then 
setElementData ( source, "baga", false ) 
    end 
end 

client side:

function onHit () 
localPlayer = getLocalPlayer () 
local Mrandom = math.random (1000, 2000, 3000, 500, 100, 50) 
if getElementData(source, "baga") then 
   givePlayerMoney (localPlayer, Mrandom) 
else 
    outputChatBox ("get the bag and back", source, 255, 0, 0, false) 
    end 
end 
addEvent ("OCMHjob", true) 
addEventHandler ("OCMHjob", getRootElement, onHit) 

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