Guest User

Untitled

a guest
Nov 18th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. import Entity
  2. import Console
  3. import Sourcemod
  4.  
  5. myinfo = {
  6. "author": 'Necavi and PimpinJuice',
  7. "name": "Prop Explorer",
  8. "version": "1.0"
  9. }
  10.  
  11. def GetPropInt(args, argStr):
  12. print args
  13. entityIndex = int(args[1])
  14. propName = args[2]
  15.  
  16. if not Entity.IsValidEdict(entityIndex) or not Entity.IsValidEntity(entityIndex):
  17. raise("Not a valid entity index: {0}".format(entityIndex))
  18.  
  19. offset = Entity.FindDataMapInfo(entityIndex, propName).Offset
  20.  
  21. if offset == -1:
  22. raise("Not a valid property name (ent {0}): {1}".format(entityIndex, propName))
  23.  
  24. Console.PrintToServer("Value (offset {0}) = {1}".format(offset, Entity.GetEntityInt(entityIndex, offset)))
  25.  
  26. return Sourcemod.ResultType.Handled
  27.  
  28. # Add in a command
  29. Console.RegisterServerCommand("get_prop_int", GetPropInt, "Get entity prop int")
Add Comment
Please, Sign In to add comment