Jump to content

Water level


Recommended Posts


I tryed it in my script..

No errors came

function buyWater (source) 
    thePlayer = source 
    cash = getPlayerMoney(source) 
    local nick = getPlayerName(source)  
    local x,y,z = getElementPosition(source) 
    local level = getElementData(source,"Level") 
    if level > 19.99 and cash > 5000 then 
    outputChatBox("#FFFFFF" .. nick .. " #FF0000buys sea storm, watchout!", getRootElement(), 255, 255, 255, true) 
    givePlayerMoney ( thePlayer, -5000 )  else 
    outputChatBox("You need more cash or your level does not meet the requirements", source, 255, 255, 255, true) 
addCommandHandler("buyseastorm", buyWater) 

Even tryed this:

to see does this even work

addCommandHandler( "waterlevel", 
    function ( plr, cmd, newlevel ) 
        setWaterLevel( tonumber( newlevel ) ); 

And nothing, maybe its cause im on race gamemode ? I've added admin rights to resource too

Link to comment
  • Moderators

yes I can see you do it by command, but the command:

/waterlevel 30


And nothing, maybe its cause im on race gamemode ?

afaik yes, the race resource is editing the water level every round you play.

But has nothing to do with admin rights.

Link to comment
addCommandHandler( "waterlevel", 
    function ( plr, cmd, newlevel ) 
        if not newlevel then outputChatBox("Please type the level you want",plr,255,0,0) return end 
        if newlevel and tonumber ( newlevel ) then 
        setWaterLevel( tonumber( newlevel ) ); 
        outputChatBox("Water level successfully change to "..newlevel,plr,255,0,0) return end 

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