Jump to content

getWaterLevel ServerSide


#Humber*

Recommended Posts

use triggerClientEvent, use this kind of function

TheTimer = setTimer( 
function() 
-- your stuff-- 
end, 1000, 0) 

setTimer of triggerclient event example which you could add in that function

setTimer(triggerClientEvent, 1000, 0, element, "event", element) 

1: means once only

0: means endless

Link to comment

Good idea. I will try. But, can I use this?

client

  
function setWL() 
    theTimer = setTimer(setWaterLevel, 100, 0, getWaterLevel()+0.1) 
end 
addEvent("setWaterL") 
addEventHandler("setWaterL", root, setWL) 
  

server

  
addCommandHandler("tsunami",  
    function(source) 
        local sourceAccount = getPlayerAccount(source) 
        if isObjectInACLGroup("user."..getAccountName(sourceAccount), aclGetGroup("Admin")) then 
            triggerClientEvent(source, "setWaterL") 
        end 
    end 
) 
  

Link to comment

i don't see anything wrong but i think yeah give it a try! if there is something wrong tell me whats wrong.

better if u mix getplayeracc and get account name.

addCommandHandler("tsunami", 
    function(source) 
        local sourceAccount = getAccountName ( getPlayerAccount ( source ) ) 
        if isObjectInACLGroup("user."..sourceAccount, aclGetGroup("Admin")) then 
            triggerClientEvent(source, "setWaterL", source) 
        end 
    end 
) 

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