Jump to content

[HELP] Hunter Kills Help


explOdeR

Recommended Posts

Guys i Make a Scoreboard Add ' Hunter Kills ' but dont work if u can help me i will give u the MOST BIG Thanks ! :D Thx Here is the code :

exports.scoreboard:addScoreboardColumn('Hunter Kills') 
  
addEvent("onClientExplosion",true) 
addEventHandler("onClientExplosion",root, 
function (killer) 
    givePlayerMoney(killer,50) 
    addPlayerHunterKills(killer) 
  
end) 
  
  
function ClientExplosionFunction(x,y,z,theType) 
if getElementType ( source ) == "vehicle" then  
driver = getVehicleOccupant ( source ) 
if driver then 
outputChatBox ( tostring ( getPlayerName ( driver ) ) ) 
end 
end 
end 
addEventHandler("onClientExplosion",getRootElement(),ClientExplosionFunction) 

:)

Link to comment

this will add a column to the scoreboard named 'HUNTER'

addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), 
    function() 
        call(getResourceFromName("scoreboard"),"scoreboardAddColumn","hunterkills",nil,70,"HUNTER") 
    end 
) 

then use this below in a function when a player joins. (hint: you need to put it in "onPlayerJoin")

setElementData(source,"hunterkills","0") 

then u need a similar line adding in onPlayerWasted to update the kills amount.

i wont do all the work for u... have a go and see if u can finish it.

when u get stuck, post back what u have and we will help u fix it.

good luck.

Link to comment

try this

---serverSide 
exports.scoreboard:addScoreboardColumn('Hunter Kills') 
  
addEvent("onClientVehicleExplosion",true) 
addEventHandler("onClientVehicleExplosion",root, 
function (killer) 
local add = getElementData("Hunter Kills") 
setElementData("Hunter Kills", add+1) 
    givePlayerMoney(killer, 100) 
end) 

--- client side 
function Explode () 
local him = getPlayerName( killer)  
local i = getPlayerName( source ) 
    if getElementType ( killer ) =="vehicle" then 
    triggerServerEvent ( "onClientVehicleExplosion",getRootElement()) 
    driver = getVehicleOccupant ( killer ) 
    if driver then 
    outputChatBox( tostring ".. him Has Killed .. i and got +1 Hunter Killes",255,255,0) 
end 
end 
end 
addEventHandler("onClientVehicleExplosion",getRootElement(),Explode) 

Link to comment
try this
---serverSide 
exports.scoreboard:addScoreboardColumn('Hunter Kills') 
  
addEvent("onClientVehicleExplosion",true) 
addEventHandler("onClientVehicleExplosion",root, 
function (killer) 
local add = getElementData("Hunter Kills") 
setElementData("Hunter Kills", add+1) 
    givePlayerMoney(killer, 100) 
end) 

--- client side 
function Explode () 
local him = getPlayerName( killer)  
local i = getPlayerName( source ) 
    if getElementType ( killer ) =="vehicle" then 
    triggerServerEvent ( "onClientVehicleExplosion",getRootElement()) 
    driver = getVehicleOccupant ( killer ) 
    if driver then 
    outputChatBox( tostring ".. him Has Killed .. i and got +1 Hunter Killes",255,255,0) 
end 
end 
end 
addEventHandler("onClientVehicleExplosion",getRootElement(),Explode) 

Wtf! First, tabulate your code. Second, this is a really mess. You are trying to do "if the killer is a vehicle then" LOL Who is killer?

onClientVehicleExplosion don't exist.

it's onClientVehicleExplode.

https://wiki.multitheftauto.com/wiki/Scr ... troduction

http://lua-users.org/wiki/TutorialDirectory/

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...