masodikbela

pc_get_ip

Jul 17th, 2016
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1.     int pc_get_ip(lua_State* L)
  2.     {
  3.         LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
  4.         if (!ch || !ch->GetDesc())
  5.         {
  6.             lua_pushstring(L, "0.0.0.0");
  7.             return 1;
  8.         }
  9.  
  10.         lua_pushstring(L, inet_ntoa(ch->GetDesc()->GetAddr().sin_addr));
  11.  
  12.         return 1;
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment