Jump to content

[Ayuda] Que evento debo usar


DuFraN

Recommended Posts

Hola, estoy creando un sistema de niveles para mi server race, este funciona con exp pero la única manera en que logro que se actualice mi nivel es con "onPlayerLogin", como le hago para que se actualice cuando ya tenga la exp necesaria?, que evento debo usar :3

Link to comment

Dufran seria algo como esto, solo es un ejemplo no se si te ayude, pero yo creo qe si, tu y yo nos entendemos e-e

function refresh(thePlayer) 
    local account = getPlayerAccount(thePlayer) 
    if not (isGuestAccount(account)) then 
        local EXP = tonumber(getAccountData(account,"exp")) 
        setElementData(thePlayer,"exp",EXP) 
    else  
        setElementData(thePlayer,"exp","none") 
    end 
end 
  
function refresh2() 
    refresh(thePlayer) 
end 
addEventHandler("onPlayerLogout",getRootElement(),refresh2) 
addEventHandler("onPlayerLogin",getRootElement(),refresh2) 
addEventHandler("onPlayerWasted",getRootElement(),refresh2) 

Edited by Guest
Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...