marcoshps11
New Member
- Joined
- Jan 29, 2011
- Messages
- 25
- Reaction score
- 0
could someone help me convert this code to tfs 1.3
C:
//isPlayerUsingOtclient(cid)
lua_register(m_luaState, "isPlayerUsingOtclient", LuaInterface::luaIsPlayerUsingOtclient);
//doSendPlayerExtendedOpcode(cid, opcode, buffer)
lua_register(m_luaState, "doSendPlayerExtendedOpcode", LuaInterface::luaDoSendPlayerExtendedOpcode);
int32_t LuaInterface::luaIsPlayerUsingOtclient(lua_State* L)
{
//isPlayerUsingOtclient(cid)
ScriptEnviroment* env = getEnv();
if(Player* player = env->getPlayerByUID(popNumber(L))) {
lua_pushboolean(L, player->isUsingOtclient());
}
lua_pushboolean(L, false);
return 1;
}
int32_t LuaInterface::luaDoSendPlayerExtendedOpcode(lua_State* L)
{
//doSendPlayerExtendedOpcode(cid, opcode, buffer)
std::string buffer = popString(L);
int opcode = popNumber(L);
ScriptEnviroment* env = getEnv();
if(Player* player = env->getPlayerByUID(popNumber(L))) {
player->sendExtendedOpcode(opcode, buffer);
lua_pushboolean(L, true);
}
lua_pushboolean(L, false);
return 1;
}