Raise money cap?

For some reason the money is capped at: 2147483648 . I checked the whole script and I couldn’t find that number any where. I started off fresh and then increased my money, it still gets capped. Don’t know why.

Can anyone help me?

Contents of money.lua below:



if ( !sql.TableExists( "rpdmmoney" ) ) then
	
	sql.Query( "CREATE TABLE IF NOT EXISTS rpdmmoney (SteamID char(20) NOT NULL, Money INTEGER NOT NULL, PRIMARY KEY(SteamID))" )
end

local sql		=	sql
local Format	=	Format
local SQLStr	=	SQLStr

local meta = FindMetaTable( "Player" )

local function FormatID( str )
	
	return str:lower():gsub( ":", "_" )
end

function UpdateMoney( self, value )
	
	umsg.Start( "MoneyChange", self )
		
		umsg.Short( 0 )
		umsg.Long( value )
		
	umsg.End( )
end

function SetMoney( self )
	local id
	
	id = self:SteamID()
	id = FormatID( id )
	
	if ( tonumber( self.Money ) ~= nil ) then
		local str = Format( "UPDATE rpdmmoney SET Money = %s WHERE SteamID = %s", self.Money, SQLStr( id ) )
		
		sql.Query( str )
	end
end

function GetMoney( self )
	local id, money
	
	id = self:SteamID()
	id = FormatID( id )
	
	money = sql.QueryValue( Format( "SELECT Money FROM rpdmmoney WHERE SteamID = %s", SQLStr( id ) ) )
	money = tonumber( money ) || sql.Query( Format( "INSERT INTO rpdmmoney (SteamID, Money) VALUES (%s, 5000)", SQLStr( id ) ) ) || 10000
	
	self.Money = math.min( math.ceil( money ), 1000000000000 )
	
	UpdateMoney( self, self.Money )
end

// aliases for nigtits
setMoney = SetMoney
getMoney = GetMoney


By messing around with calculator, I have determined that 2147483648 is in fact 2 to the 31 power. That means a variable in the script is limited where 2147483648 is the highest it can go. To fix this, find the specific variable that is limited(AKA can not go higher then 2147483648) and change its type throughout the entire script to a variable that can support numbers higher then that.

I can’t fathom why you would need 2 billion dollars in the first place. If you can give yourself that much, you might as well just give yourself stuff for free and cut out the middle man (or money, in this case).

But if you honestly need more, something tells me the only way to do it is to store your money across multiple variables. I’d limit each variable to 2,000,000,000 even, for simplicity.

What I would do is store it in separate variables. When you have more than 2 billion dollars, start filling up a new variable instead.