DuFraN Posted January 20, 2014 Posted January 20, 2014 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
Alexs Posted January 20, 2014 Posted January 20, 2014 Al momento de darle la 'exp', revisas si ya tiene el total necesario para subir de level y se lo actualizas.
FraN-724 Posted January 21, 2014 Posted January 21, 2014 (edited) 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 January 21, 2014 by Guest
DuFraN Posted January 21, 2014 Author Posted January 21, 2014 Ok ya, e.e usare onPlayerWasted, gracias FraN <3 y a ti tambien Alex :3
Recommended Posts