Git Product home page Git Product logo

Comments (9)

ImagicTheCat avatar ImagicTheCat commented on August 30, 2024

I don't see anything in the admin module related to money, did you update the files properly ? While checking the cfg differences ?

from vrp.

ZirconiumUE avatar ZirconiumUE commented on August 30, 2024

It's my fault.. I have add a function give money in the admin module (the function is fonctionnal but why i have the error ??)

from vrp.

ImagicTheCat avatar ImagicTheCat commented on August 30, 2024

I highly discourage you from doing modification of the core files, adding functionalities should be done in a separate resource (vrp_mod for example) or in the cfg files. For your problem, you have a nil value somewhere, maybe you forgot a nil check.

from vrp.

ZirconiumUE avatar ZirconiumUE commented on August 30, 2024

Not miss nil in my code

local function ch_givemoney(player,choice)
  local user_id = vRP.getUserId(player)
  if user_id ~= nil and vRP.hasPermission(user_id,"player.givemoney") then
    vRP.prompt(player,"Id du joueur: ","",function(player,id)
      id = tonumber(id)
      vRP.prompt(player,"Montant a lui donner: ","",function(player,amount)
        vRP.giveMoney(id,amount)
        vRPclient.notify(player,{"Tu as Give "..amount.." à "..id})
      end)
    end)
  end
end

from vrp.

ImagicTheCat avatar ImagicTheCat commented on August 30, 2024

You didn't check the amount.
amount should be a number, as the id.

from vrp.

ZirconiumUE avatar ZirconiumUE commented on August 30, 2024

Ok now is good ^^ ?

local function ch_givemoney(player,choice)
  local user_id = vRP.getUserId(player)
  if user_id ~= nil and vRP.hasPermission(user_id,"player.givemoney") then
    vRP.prompt(player,"Id du joueur: ","",function(player,id)
      id = tonumber(id)
      vRP.prompt(player,"Montant a lui donner: ","",function(player,amount)
	  amount = tonumber(amount)
        vRP.giveMoney(id,amount)
        vRPclient.notify(player,{"Tu as Give "..amount.." à "..id})
      end)
    end)
  end
end

from vrp.

ImagicTheCat avatar ImagicTheCat commented on August 30, 2024

I have no idea, you tell me.

from vrp.

ZirconiumUE avatar ZirconiumUE commented on August 30, 2024

Ok i test it

from vrp.

ZirconiumUE avatar ZirconiumUE commented on August 30, 2024

I've resolved this

from vrp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.