Newbie Posted March 22, 2015 Share Posted March 22, 2015 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
WhoAmI Posted March 22, 2015 Share Posted March 22, 2015 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
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