Jump to content

ERRO DE DELAYCOMMAND


Recommended Posts

Erro:  'end' expected (to close 'function' at line 5) near '<eof>'

Server Side


 

function dxMsg(source, text, type)
    exports.dxmessages:outputDx(source, text, type)
end

function darDinheiro (source)
    if commandDelay[source] == nil and not istimer(commandDelay[source]) then 

    local Dinheiro = getPlayerMoney(source)
    if Dinheiro >= 1200 then 

       return dxMsg(source, "Você possui dinheiro de mais para receber o auxílio.", "error")
    end

 
    givePlayerMoney(source, 1200)
    dxMsg(source, "Você recebeu o auxílio.", "success")
    resetCommand(source, 1000)
    else
        dxMsg(source, "Você ja recebeu o auxílio.", "warning")

end 

addCommandHandler('auxilio', darDinheiro)

 

Link to post

Está faltando um end para fechar a função.

function dxMsg(source, text, type)
    exports.dxmessages:outputDx(source, text, type)
end

function darDinheiro (source)
    if commandDelay[source] == nil and not istimer(commandDelay[source]) then 
    	local Dinheiro = getPlayerMoney(source)
      if Dinheiro >= 1200 then 
         return dxMsg(source, "Você possui dinheiro de mais para receber o auxílio.", "error")
      end
      givePlayerMoney(source, 1200)
      dxMsg(source, "Você recebeu o auxílio.", "success")
      resetCommand(source, 1000)
    else
        dxMsg(source, "Você ja recebeu o auxílio.", "warning")
	end
end 

addCommandHandler('auxilio', darDinheiro)

 

Link to post

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