Jump to content

Problem With Call Resource


iFoReX

Recommended Posts

Posted

@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) 

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
Posted (edited)

:/

I said about tabulation. Can you hear me?

Also you not written what's wrong.

Edited by Guest

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

Where is "zombieKills" defined?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

What is "addPlayerZombieKills" function supposed to do?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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) 

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
Posted
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.

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

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