Jump to content

How to get money when kill a zombie ?


Recommended Posts

  • 2 weeks later...
Posted

I don't see why you should search for such a easy script, you only need to have basic knowledge of scripting.

You would need to combine the event: "onZombieWasted" with givePlayerMoney.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
I don't see why you should search for such a easy script, you only need to have basic knowledge of scripting.

You would need to combine the event: "onZombieWasted" with givePlayerMoney.

Im still bigner for scripting i can do simple things like "onPlayerSpawn giveWeapon" and somethings easy

But im very good mapper :D

Posted

It's the exact same thing - listen for the event, act on it.

Also, this is a scripting issue, so I'm moving it.

Do NOT PM ME for help unless invited. - New MTA Script Editor

Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.

  • MTA Team
Posted (edited)

This may work:

  
local ZOMBIE_REWARD = 50 -- The amount of money rewarded to a player once killed 
  
addEventHandler('onZombieWasted', root,  
    function(player) 
        givePlayerMoney(player, ZOMBIE_REWARD) 
    end 
) 
  

Update the first line. I have guessed the syntax of the event.

Edited by Guest
Posted

That won't work, you forgot about: addEvent and "root" at second argument of addEventHandler.

local ZOMBIE_REWARD = 50 -- The amount of money rewarded to a player once killed 
  
addEvent ( "onZombieWasted", true ) 
addEventHandler ( "onZombieWasted", root, 
    function ( player ) 
        givePlayerMoney ( player, ZOMBIE_REWARD ) 
    end 
) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

He already got what he was looking for, i don't know why you still posting and try to help him lol

CiTLh.png

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