• 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!

C++ Global storage in c++ tfs 1.2

majsters

New Member
Joined
Jun 7, 2010
Messages
18
Reaction score
1
How to check GLOBAL storage value in c++?

This is for normal storage:
int32_t value;
if (attackerPlayer && attackerPlayer != this && getStorageValue(5000, value) == 1 && skillLoss


getGlobalStorageValue(5000, value) == 1 <-not work
game.getStorageValue(5000, value) == 1 <-not work
g_game.getStorageValue(5000, value) == 1 <-not work
 
Global storage in TFS 1.2 is just a global Lua table. If you wanna get values from it you have to something with
C++:
lua_State* luaState = g_luaEnvironment.getLuaState();
lua_getglobal(luaState, "globalStorageTable");

That will push the table reference to the stack, make sure to pop it after getting what you want.
 
Back
Top