• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

[Function] isStorageBetween(cid, storage, minValue, maxValue)

Erexo

Kage
Premium User
Joined
Mar 27, 2010
Messages
741
Solutions
5
Reaction score
193
Location
Pr0land
GitHub
Erexo
Hello,
simple and useful, check if player have storage value between two numbers (also if have one of that two).

Lua:
function isStorageBetween(cid, storage, minValue, maxValue)
  if getPlayerStorageValue(cid, storage) >= minValue and getPlayerStorageValue(cid, storage) <= maxValue then
    return true
  end
  return false
end
 
I guess if it's not in the min-max value will get error cus you dont define it
I say I GUESS
 
Code:
function isStorageBetween(cid, storage, minValue, maxValue)
local val = getPlayerStorageValue(cid, storage)
return (val >= minValue and val <= maxValue)
end
 
Code:
function isStorageBetween(cid, storage, minValue, maxValue)
local val = getPlayerStorageValue(cid, storage)
return (val >= minValue and val <= maxValue)
end

yours will return error when is not in between i guess, just check it with a return true and false
 
yours will return error when is not in between i guess, just check it with a return true and false

His scripts returns the value of "(val >= minValue and val <= maxValue)" statement, so it's either true or false. Won't popup an error.
 
Back
Top