explOdeR Posted February 16, 2012 Share Posted February 16, 2012 Guys i Make a Scoreboard Add ' Hunter Kills ' but dont work if u can help me i will give u the MOST BIG Thanks ! 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
Castillo Posted February 16, 2012 Share Posted February 16, 2012 That's just a mess, I suggest you to go back to the wiki and learn properly how to make it. Link to comment
explOdeR Posted February 17, 2012 Author Share Posted February 17, 2012 lol i read the wiki 2 rounds ..... im bored to read read and read i need help , if the forum dont give me the help just i will read again Link to comment
Scooby Posted February 17, 2012 Share Posted February 17, 2012 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
Evil-Cod3r Posted February 17, 2012 Share Posted February 17, 2012 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
drk Posted February 17, 2012 Share Posted February 17, 2012 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
explOdeR Posted February 17, 2012 Author Share Posted February 17, 2012 Thanks all i Make it so close thx very Much ,thanks ! Link to comment
Recommended Posts