Jump to content

Search the Community

Showing results for tags 'arithmetic'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 1 result

  1. Attempt to do arithmetic on a nil value. And the code is: --Here you have the tables playersT = {"VaporZ"} moneyT = {"100"} addCommandHandler("deposit", function(player, commandName, amount) --Here is our "nil" value (I often use "100" for "amount", when I have $12,000) for k, v in ipairs(playersT) do if(string.match(playersT[k], getPlayerName(player))) then if amount and (tonumber(amount) <= getPlayerMoney(player)) then local i = table.find(players, getPlayerName(player)) local am = tonumber(amount) --Setting "am" as "amount", but changed into number takePlayerMoney(player, am) --Here's everyting ok moneyToLow = tonumber(moneyT[i]) - am --But here is a problem with "am" IDK why ("Attempt to do arithmetic on a nil value") moneyT[i] = tostring(moneyToLow) outputChatBox ("#09ff00Transfered into bank account #ffffff$" .. amount .. "#09ff00!", player, 255, 255, 255, true) end elseif(not string.match(playersT[k], getPlayerName(player))) then local size = table.size(playersT) local i = size + 1 playersT[i] = getPlayerName(player) moneyT[i] = amount takePlayerMoney(player, tonumber(amount)) outputChatBox ("#09ff00Transfered to bank account #ffffff$" .. amount .. "#09ff00!", player, 255, 255, 255, true) end end end) I will say only one thing - What The *F word here*?! Help!
×
×
  • Create New...