Jump to content

Hunter pickup


Newbie

Recommended Posts

function checkForHunter(number,sort,model) 
    if sort == "vehiclechange" then 
        if model == 425 then 
            if (getElementData(source, "Hunter") == false) then 
                setTimer(hunterBonus,200,1,source) 
            end 
        end 
    end 
end 
addEvent('onPlayerPickUpRacePickup') 
addEventHandler("onPlayerPickUpRacePickup",getRootElement(),checkForHunter) 
  
addEvent("onMapStarting", true) 
addEventHandler("onMapStarting", getRootElement(), 
    function() 
        for i,v in ipairs(getElementsByType('player')) do 
            setElementData(v, "Hunter", false) 
        end 
    end) 

So far i made that player cannot take a hunter again, but there's problem, some maps has "stacked" hunter pickups, and it gives me bonus many times.. is there any way to fix it ?

Link to comment

After getting a pickup set data "Hunter" player to true. Like that

function checkForHunter(number,sort,model) 
    if sort == "vehiclechange" then 
        if model == 425 then 
            if (getElementData(source, "Hunter") == false) then 
                setTimer(hunterBonus,200,1,source) setElementData ( source, "Hunter", true ) 
            end  
        end 
    end 
end 
addEvent('onPlayerPickUpRacePickup') 
addEventHandler("onPlayerPickUpRacePickup",getRootElement(),checkForHunter 
  

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