Hello, sorry for post but where exacly put this lines? I dont have getPlayerSecureMode(cid) and getPlayerFightMode(cid). Best regardsluascript.cpp
getPlayerSecureMode(cid):
PHP:int32_t LuaScriptInterface::luaGetPlayerSecureMode(lua_State* L) { //getPlayerSecureMode(cid) ScriptEnviroment* env = getEnv(); Player* player = env->getPlayerByUID((uint32_t)popNumber(L)); if(!player) { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); } else lua_pushnumber(L, player->getSecureMode()); return 1; }
getPlayerFightMode(cid):
PHP:int32_t LuaScriptInterface::luaGetPlayerFightMode(lua_State* L) { //getPlayerFightMode(cid) ScriptEnviroment* env = getEnv(); Player* player = env->getPlayerByUID((uint32_t)popNumber(L)); if(!player) { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); } else lua_pushnumber(L, player->getAttackFactor()); return 1; }
simple and useful.
Hello, sorry for post but where exacly put this lines? I dont have getPlayerSecureMode(cid) and getPlayerFightMode(cid). Best regards
Find luaGetPlayerModes, under it paste the functions Oskar posted. Then find@up
paste it anywhere in luascript.cpp ?
PS: can You do this for me?
//getPlayerModes(cid)
lua_register(m_luaState, "getPlayerModes", LuaInterface::luaGetPlayerModes);
//getPlayerSecureMode(cid)
lua_register(m_luaState, "getPlayerSecureMode", LuaInterface::getPlayerSecureMode);
//getPlayerFightMode(cid)
lua_register(m_luaState, "getPlayerFightMode", LuaInterface::getPlayerFightMode);
static int32_t luaGetPlayerModes(lua_State* L);
static int32_t getPlayerSecureMode(lua_State* L);
static int32_t getPlayerFightMode(lua_State* L);
int32_t LuaInterface::luaGetPlayerModes(lua_State* L)
{
//getPlayerModes(cid)
ScriptEnviroment* env = getEnv();
Player* player = env->getPlayerByUID(popNumber(L));
if(!player)
{
errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
lua_pushboolean(L, false);
return 1;
}