Jump to content

Help needed


Newbie

Recommended Posts

addEvent ( "myEvent", true ) 
addEventHandler ( "myEvent", root, 
    function ( win, dead ) 
        guiSetText ( GUIEditor_label [ 2 ], "  Wins:".. tostring ( win ) ) 
        guiSetText ( GUIEditor_label [ 3 ], "  Deaths:".. tostring ( dead ) ) 
    end 
) 

Link to comment

Works! Thanks! Got some questions

1.My data of wins is 0 so in label shows a "nil"

Deaths working fine and other all data that is above 0

Possible to show it as 0 not as nil ? Did it no needed anymore

2. Update stats ? Bec it updates only on login How to ?

Link to comment

Thanks for your help Solidsnake!

I did like this:

function statss() 
    if isElement( source ) then 
        local account = getPlayerAccount( source ) 
        if account then 
            if isGuestAccount( account ) then return end 
            local account = getPlayerAccount( source ) 
            local win = tonumber(getAccountData(account, "Wins")) or 0 
            local dead = tonumber(getAccountData(account, "Deaths")) or 0 
            local tim = tonumber(getAccountData(account, "Time")) or 0 
            local hunt = tonumber(getAccountData(account, "Hunters")) or 0   
            local xp = tonumber(getAccountData(account, "EXP")) or 0     
            local cas = tonumber(getAccountData(account, "Cash")) or 0   
            local mapp = tonumber(getAccountData(account, "Maps")) or 0      
            local bmap = tonumber(getAccountData(account, "BuyMaps")) or 0   
            local luc = tonumber(getAccountData(account, "Lucky")) or 0  
            local sou = tonumber(getAccountData(account, "Sound")) or 0          
            triggerClientEvent(source,"myEvent",root,win,dead,tim,hunt,xp,cas,mapp,bmap,luc,sou) 
            end 
        end 
end 
addEventHandler("onPlayerLogin",root, statss ) 
addEventHandler("onElementDataChange",root, statss ) 

Working fine too :D

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