Advertisement
Guest User

luascript.cpp

a guest
Feb 10th, 2013
1,303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.39 KB | None | 0 0
  1. 2476,62476,12
  2. //getConfigFile()
  3. lua_register(m_luaState, "getConfigFile", LuaInterface::luaGetConfigFile);
  4.  
  5. +//isPlayerUsingOtclient(cid)
  6. +lua_register(m_luaState, "isPlayerUsingOtclient", LuaInterface::luaIsPlayerUsingOtclient);
  7. +
  8. +//doSendPlayerExtendedOpcode(cid, opcode, buffer)
  9. +lua_register(m_luaState, "doSendPlayerExtendedOpcode", LuaInterface::luaDoSendPlayerExtendedOpcode);
  10. +
  11. //getConfigValue(key)
  12. lua_register(m_luaState, "getConfigValue", LuaInterface::luaGetConfigValue);
  13.  
  14. 9471,69477,32
  15.      return 1;
  16. }
  17.  
  18. +int32_t LuaInterface::luaIsPlayerUsingOtclient(lua_State* L)
  19. +{
  20. +    //isPlayerUsingOtclient(cid)
  21. +    ScriptEnviroment* env = getEnv();
  22. +    if(Player* player = env->getPlayerByUID(popNumber(L))) {
  23. +        lua_pushboolean(L, player->isUsingOtclient());
  24. +    }
  25. +    lua_pushboolean(L, false);
  26. +    return 1;
  27. +}
  28. +
  29. +int32_t LuaInterface::luaDoSendPlayerExtendedOpcode(lua_State* L)
  30. +{
  31. +    //doSendPlayerExtendedOpcode(cid, opcode, buffer)
  32. +    std::string buffer = popString(L);
  33. +    int opcode = popNumber(L);
  34. +
  35. +    ScriptEnviroment* env = getEnv();
  36. +    if(Player* player = env->getPlayerByUID(popNumber(L))) {
  37. +        player->sendExtendedOpcode(opcode, buffer);
  38. +        lua_pushboolean(L, true);
  39. +    }
  40. +    lua_pushboolean(L, false);
  41. +    return 1;
  42. +}
  43.  
  44. int32_t LuaInterface::luaGetPartyMembers(lua_State* L)
  45. {
  46. //getPartyMembers(cid)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement