Jump to content

Good??


CheiN

Recommended Posts

Posted
-- define the event handler function 
function onWasted(killer, weapon, bodypart) 
     givePlayerMoney(killer, 1000) 
end 
  
-- add the event handler 
addEventHandler("onClientPlayerWasted", getRootElement(), onWasted) 

Im good?? The thing is.. If a projectile kill a player u will get money

My scripts: toptimes on scoreboard (server21)

Screen on login(scren)

Score on scoreboard (score)

Posted

1: The money should be given server side, as if you give it client side it won't make any effect.

2: By a projectile you mean a rocket fired to your vehicle? if so, then this won't work.

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

umm, I don't think that would be enough.

try this:

local projectiles = { 
    [16]=true, 
    [17]=true, 
    [18]=true, 
    [39]=true 
    } 
function onWasted(killer, weapon, bodypart) 
    --First get the weapon type 
    if projectiles[weapon] then --this checks if it's a projectile 
        givePlayerMoney(killer, 1000) --if it is, then give the player the money 
    end 
end 
addEventHandler("onPlayerWasted",root, onWasted) 

Please read more on this page: Weapons

My in-game name: Jaysds1

Retired CMG Scripter

World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode

Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

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