Lowcafraguw Posted March 27, 2017 Posted March 27, 2017 (edited) Hello again. I come to ask you for help guys. I want to add to a scoreboard total kills/zombie/total time but i don't know how to do this. Would you be so nice and do it for me? Or at least tell me how to do it by myself. Please answer ASAP. Thanks. Scoreboard: http://www51.zippyshare.com/v/fSuQZ8zy/file.html Edited March 27, 2017 by Lowcafraguw
itHyperoX Posted March 27, 2017 Posted March 27, 2017 for kills: exports.scoreboard:addScoreboardColumn("Kills",getRootElement(),7,55) addEventHandler("onPlayerWasted",root,function(totalAmmo,killer,killerWeapon,bodypart,stealth) if ( killer ) then local accountKiller = getPlayerAccount ( killer ) if ( getElementType(killer) == "player" ) then setAccountData(accountKiller,"Kills",tonumber(getAccountData(accountKiller,"Kills") or 0 ) + 1 ) setElementData(killer,"Kills",tonumber(getAccountData(accountKiller,"Kills"))) end end end) addEventHandler("onPlayerLogin",root,function(thePreviousAccount,theCurrentAccount,autoLogin) local account = getPlayerAccount ( source ) if not getAccountData( account,"account:Kills" ) then setAccountData( account,"account:Kills",0 ) end setElementData(source,"Kills",tonumber(getAccountData(account,"account:Kills" ) or 0 ) ) end) For total time (This is give +1 level every played hours) setTimer(function() if getElementData(localPlayer,"Level") then setElementData(localPlayer,"Level",getElementData(localPlayer,"Level") + 1) end end, 36*100000, 0)
MTA Team Lpsd Posted March 27, 2017 MTA Team Posted March 27, 2017 (edited) Please don't use file upload sites to share your code, paste it into code blocks instead (using the "<>" formatting button in the topic editor). Provide us with the relevant piece of code and the error messages you're receiving with the code you've already tried, rather than the entire resource. Most people won't be as kind as @TheMOG; to write it for you, if you don't give us any relevant information. Edited March 27, 2017 by LopSided_
Lowcafraguw Posted March 27, 2017 Author Posted March 27, 2017 Thank you so much for your replies. The problem is i never tried anything because i don't know how to start. I'm so lame that i don't even know where to paste the code that TheMOG sent me. Don't judge me please. 1 hour ago, LopSided_ said: Please don't use file upload sites to share your code, paste it into code blocks instead (using the "<>" formatting button in the topic editor). I'll remember. Thanks.
NeXuS™ Posted March 27, 2017 Posted March 27, 2017 First of all, start reading the Wiki page. Without trying, you wont get anywhere. You'll have to make a resource to be able to load that code which @TheMOG sent you.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now