Jump to content

Vip Time not diminish


Dolinho

Recommended Posts

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

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