Jump to content

Help me !!!


medus

Recommended Posts

Posted (edited)

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
  • Moderators
Posted (edited)

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

Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime - Lao Tzu

Posted

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

Datastore - Store data to a database quickly. (Useful for saving scripted tables)

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