golanu21 Posted August 3, 2013 Share Posted August 3, 2013 ---server addEventHandler( "onPlayerQuit", root, function () local lvl1 = getElementData(source, "lvl1") local lvl2 = getElementData(source, "lvl2") if (lvl1) then setAccountData(getPlayerAccount(source), "lvl1", lvl1) elseif (lvl2) then setAccountData(getPlayerAccount(source), "lvl2", lvl2) end end ) addEventHandler("onPlayerLogin", root, function(_, account) local lvl1 = getAccountData(account, "lvl1") local lvl2 = getAccountData(account, "lvl2") if (lvl1) then triggerClientEvent("lvl1", getRootElement()) outputChatBox("ai facut lvl1", source) elseif (lvl2) then triggerClientEvent("lvl2", getRootElement()) outputChatBox("ai facut lvl2", source) end end ) --client elseif progCount == 1 then guiSetText(nivlab, "1") lvl1 = guiGetText(nivlab) if lvl1 == "1" then setElementData(localPlayer, "lvl1", lvl1) end guiProgressBarSetProgress ( progressBar, ( guiProgressBarGetProgress ( progressBar ) + 45) ) elseif progCount == 2 then guiProgressBarSetProgress ( progressBar, ( guiProgressBarGetProgress ( progressBar ) + 40) ) guiSetText(nivlab, "2") -- 2 lvl2 = guiGetText(nivlab) if lvl2 == "2" then setElementData(localPlayer, "lvl2", lvl2) end function getlevel () progCount = 1 end addEvent ( "lvl1", true ) addEventHandler ( "lvl1", getRootElement(), getlevel ) function getlevel2 () progCount = 2 end addEvent ( "lvl2", true ) addEventHandler ( "lvl2", getRootElement(), getlevel2 ) -- i can't setaccount data for progCount (level system) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now