CapsAdmin

Untitled

Mar 28th, 2011
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. LuaObj(IEntity)
  2. {
  3.     function(IEntity, __tostring)
  4.         lua_pushfstring(L, "IEntity[%d][%s]", self->GetId(), self->GetClass()->GetName());
  5.     end
  6.  
  7.     function(IEntity, __len)
  8.         lua_pushnumber(L, self->GetId());
  9.     end
  10.  
  11.     function(IEntity, GetClass)
  12.         lua_pushstring(L, self->GetClass()->GetName());
  13.     end
  14.  
  15.     function(IEntity, Remove)
  16.         gEnv->pEntitySystem->RemoveEntity(self->GetId(), true);
  17.     end0
  18.  
  19.     function(IEntity, SetSize)
  20.         self->SetScale(Vec3(1,1,1) * lua_tonumber(L, 2));
  21.     ends
  22.  
  23.     void Load()
  24.     {
  25.         reg(IEntity, SetSize);
  26.  
  27.         reg(IEntity, __tostring);
  28.         reg(IEntity, __len);
  29.         reg(IEntity, Remove);
  30.        
  31.         reg__newindex(IEntity);
  32.         reg__index(IEntity);
  33.         reg__eq(IEntity);
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment