Dolinho Posted May 17, 2015 Share Posted May 17, 2015 time does not diminish, can anyone help me? Client time = guiCreateLabel ( 10, 360, 290, 18, "", false ) guiSetFont(time,"default-bold-small") guiLabelSetColor(time,0,255,0) setTimer(function() guiSetText ( time,"Tempo Restante do seu vip: "..getElementData( localPlayer,"TimeVip" ).."") end,50,0) Server: addEvent('AddPlayerVip', true) addEventHandler('AddPlayerVip', root, function(wantedToApply,player) playeraccount = getPlayerFromName ( wantedToApply ) setElementData(playeraccount,"VipTimeADD","VIP-Simples") setElementData(playeraccount,"TimeVip",1000) triggerEvent ( "testetimefuture", player ) local acc = getPlayerAccount ( wantedToApply ) setAccountData(acc,"VipTimeADD",getElementData(wantedToApply,"VipTimeADD")) end) -------------Here erro ------------- function TimerCount ( ) setElementData(source,"TimeVip",getElementData(source,"TimeVip")-1) setElementData ( source, "TimeVip", Counte-1 ) end setTimer ( TimerCount, 1000, 0 ) Link to comment
Tomas Posted May 17, 2015 Share Posted May 17, 2015 addEvent('AddPlayerVip', true) addEventHandler('AddPlayerVip', root, function(wantedToApply,player) playeraccount = getPlayerFromName ( wantedToApply ) setElementData(playeraccount,"VipTimeADD","VIP-Simples") setElementData(playeraccount,"TimeVip",1000) triggerEvent ( "testetimefuture", player ) local acc = getPlayerAccount ( wantedToApply ) setAccountData(acc,"VipTimeADD",getElementData(wantedToApply,"VipTimeADD")) end) -------------Here erro ------------- function TimerCount ( ) for index, value in ipairs ( getElementsByType ( "player" ) ) do if not getElementData ( value, "TimeVip" then return end setElementData(value,"TimeVip",getElementData(value,"TimeVip")-1) setElementData ( value, "TimeVip", Counte-1 ) end end setTimer ( TimerCount, 1000, 0 ) Link to comment
Dolinho Posted May 22, 2015 Author Share Posted May 22, 2015 Thank you very much, helped me a lot. I'm glad you guys help me if not getElementData ( value, "TimeVip") then return end 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