• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Only int not double value

gmstrikker

Well-Known Member
Joined
Jul 30, 2014
Messages
458
Solutions
1
Reaction score
50
I need some help because
I want this value
Code:
config.maxOffersPerPlayer = getPlayerLevel(cid) / 20

But i don't want floats, for example: 2.5, 2.75, 2.2
I want just 2 (int value)
How to do it?
 
the types you're talking about doesn't exist in LUA. In LUA, we have the following data types;

nil, boolean, number, string, userdata, function, thread, and table

Code:
config.maxOffersPerPlayer = math.floor(getPlayerLevel(cid) / 20)

would be rather similar to explicit int casting
 
the types you're talking about doesn't exist in LUA. In LUA, we have the following data types;

nil, boolean, number, string, userdata, function, thread, and table

Code:
config.maxOffersPerPlayer = math.floor(getPlayerLevel(cid) / 20)

would be rather similar to explicit int casting

Thank you!
 
Back
Top