Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Entity
- import Console
- import Sourcemod
- myinfo = {
- "author": 'Necavi and PimpinJuice',
- "name": "Prop Explorer",
- "version": "1.0"
- }
- def GetPropInt(args, argStr):
- print args
- entityIndex = int(args[1])
- propName = args[2]
- if not Entity.IsValidEdict(entityIndex) or not Entity.IsValidEntity(entityIndex):
- raise("Not a valid entity index: {0}".format(entityIndex))
- offset = Entity.FindDataMapInfo(entityIndex, propName).Offset
- if offset == -1:
- raise("Not a valid property name (ent {0}): {1}".format(entityIndex, propName))
- Console.PrintToServer("Value (offset {0}) = {1}".format(offset, Entity.GetEntityInt(entityIndex, offset)))
- return Sourcemod.ResultType.Handled
- # Add in a command
- Console.RegisterServerCommand("get_prop_int", GetPropInt, "Get entity prop int")
Add Comment
Please, Sign In to add comment