Jump to content

Problem With Call Resource


iFoReX

Recommended Posts

@tittle please help :D

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

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
Yeah But IDK what is tabulation o.O

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

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