Jump to content

triggerClientEvent error


Chaos

Recommended Posts

Server :

  
function giveMoney(player) 
  local playerAccount = getPlayerAccount(player) 
if getAccountData(playerAccount, "CommandUsed") == false then 
givePlayerMoney(player,2000) 
outputChatBox("you got money $2000",player,0,255,0) 
setAccountData(playerAccount, "CommandUsed", true) 
timer = setTimer(setAccountData,60000,1,playerAccount,"CommandUsed",false) 
triggerClientEvent(player,"StartCount",player,timer) 
elseif getAccountData(playerAccount, "CommandUsed") == true then 
outputChatBox(" You have to wait 1 min to use this command again .",root,255,255,0) 
end 
end 
addCommandHandler("getmoney",giveMoney) 
  
  

Client:

  
function Timeinfo(timer) 
    Secs = math.ceil(getTimerDetails(timer)/ (1000) % 60 )  
    Mins = math.ceil(getTimerDetails(timer)/ (1000*60) % 60)  
    Hours = math.ceil(getTimerDetails(timer)/ (1000*60*60) % 24 ) 
guiSetText(GUIEditor.button[5],Hours..":"..Mins..":"..Secs) 
    setTimer(Timeinfo(timer),1000,0) 
end 
  
  
  
addEvent("StartCount", true) 
addEventHandler("StartCount", root, Timeinfo) 
  

1zovi1h.jpg

i'm trying to get time details on button and update the text every 1 sec but it seems can't trigger timer from server side

Edited by Guest
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...