iFoReX Posted April 21, 2012 Share Posted April 21, 2012 @tittle please help function stats( source ) local ping = getPlayerPing( source ) local money = getPlayerMoney( source ) call(getResourceFromName("zombiekills_scoreboard"), "addPlayerZombieKills", "zombieKills") outputChatBox ( " #FF0000Tu Ping es #00FF00"..ping.." ", source, 255, 255, 255, true ) outputChatBox ( " #FF0000Tu Dinero es #00FF00"..money.." ", source, 255, 255, 255, true ) outputChatBox ( " #FF0000Tus zombies Kills son #00FF00tonumber ("..zombieKills..") ", source, 255, 255, 255, true ) end addCommandHandler("stats", stats) Link to comment
Kenix Posted April 21, 2012 Share Posted April 21, 2012 (edited) I said about tabulation. Can you hear me? Also you not written what's wrong. Edited April 21, 2012 by Guest Link to comment
Castillo Posted April 21, 2012 Share Posted April 21, 2012 Where is "zombieKills" defined? Link to comment
iFoReX Posted April 21, 2012 Author Share Posted April 21, 2012 Yeah But IDK what is tabulation Edit: In the resource called Or I need define in it script ? Link to comment
Castillo Posted April 21, 2012 Share Posted April 21, 2012 What is "addPlayerZombieKills" function supposed to do? Link to comment
iFoReX Posted April 21, 2012 Author Share Posted April 21, 2012 is it exports.scoremota:addScoreboardColumn('Zombie kills') addEvent("onZombieWasted",true) addEventHandler("onZombieWasted",root, function (killer) givePlayerMoney(killer,500) addPlayerZombieKills(killer) end) function addPlayerZombieKills(killer) local account = getPlayerAccount(killer) if isGuestAccount(account) then return end local zombieKills = getAccountData(account,"Zombie kills") if not zombieKills then setAccountData(account,"Zombie kills",0) end setAccountData(account,"Zombie kills",tonumber(zombieKills)+1) end addEventHandler("onPlayerLogin",root, function () local account = getPlayerAccount(source) if isGuestAccount(account) then return end local zombieKills = getAccountData(account,"Zombie kills") if zombieKills then setElementData(source,"Zombie kills",tostring(zombieKills)) else setElementData(source,"Zombie kills",0) end end) Link to comment
Kenix Posted April 21, 2012 Share Posted April 21, 2012 Yeah But IDK what is tabulation I given you manuals about it. You just not read! Ignore .. http://en.wikipedia.org/wiki/Programming_style https://forum.multitheftauto.com/viewtop ... 91&t=41066 Example Wrong function fTest( nFinal ) if type( nFinal ) == 'number' then local nCount = 0 while nCount < nFinal do nCount = nCount + 1 end return nCount end return false end print( fTest( 9 ) ) -- 9 Correct function fTest( nFinal ) if type( nFinal ) == 'number' then local nCount = 0 while nCount < nFinal do nCount = nCount + 1 end return nCount end return false end print( fTest( 9 ) ) -- 9 You got it? Variable zombieKills not defined. Link to comment
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