Jump to content

Help me !!!


medus

Recommended Posts

When a hunter buys it, it gives money and points. But not a hunter, I want him to get money and points when someone wins. Is there anyone who can help?

 

function addHunterBonus(player)
    if isPlayerLogged(player) then
        addDataValue ( player, "cash", "500")
        addDataValue ( player, "points", "5")
        addDataValue ( player, "Hunter", "1")
        outputChatBox("[HUNTER] #FF6600 You won $500 and 5 points for Win!",player,_r,_g,_b,true)
    end
end

 

function getHunter(pickupID,pickupType,pickupModel)
    if pickupType == "vehiclechange" then
        if pickupModel == 425 then
            addWinnerBonus(source)
        end
    end
end
addEvent("onPlayerPickUpRacePickup",true)
addEventHandler("onPlayerPickUpRacePickup",getRootElement(),getHunter)

Edited by medus
Link to comment
  • Administrators

Welcome to the forums and happy holidays @medus!

Thread's been moved out of Tutorials into the Scripting section for best results.

Your duplicate has been deleted, as there's no point receiving help in 2 places regarding the same inquiry.

Edited by Tut
Link to comment
  • medus changed the title to Help me !!!

Correct me if I'm wrong but I'm assuming all you're wanting here is that when the player hits the hunter then he gets the hunter bonus ? If this is the case then the only issue with your code is that in your getHunter function, you need to change addWinnerBonus to addHunterBonus

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