Advertisement
Daz_ShadowFox

Cerberus IsDormant

Jun 23rd, 2013
657
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. // ************************************
  2. // IsDormant
  3. // Taken from Hermes
  4. // Thanks fr1kin you big fucking faggot
  5. // ************************************
  6. LUA_FUNCTION( IsDormant )
  7. {
  8. cerberus::Lua->CheckType( 1, GLua::TYPE_NUMBER );
  9.  
  10. int index = cerberus::Lua->GetNumber( 1 );
  11.  
  12. IClientEntity* pClientEntity = g_pClientEntList->GetClientEntity( index );
  13.  
  14. if ( pClientEntity )
  15. {
  16. cerberus::Lua->Push( pClientEntity->IsDormant() );
  17. return 1;
  18. }
  19. else
  20. {
  21. return 0;
  22. }
  23. }
  24.  
  25. int cerberus::open(lua_State *L) {
  26. cerberus::Lua = Lua();
  27.  
  28. CreateInterfaceFn client = (CreateInterfaceFn)GetProcAddress(GetModuleHandle("client.dll"), "CreateInterface");
  29. g_pClientEntList = (IClientEntityList*)client("VClientEntityList003", 0);
  30.  
  31. if(g_pClientEntList != NULL) {
  32. cerberus::Lua->NewGlobalTable("vmt");
  33. ILuaObject *glob_table = cerberus::Lua->GetGlobal("vmt");
  34.  
  35. if(glob_table != NULL) {
  36. glob_table->SetMember("IsDormant", IsDormant);
  37. }
  38. }
  39.  
  40. return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement