1.1 --- a/plugins/include/entity.inc Wed Mar 14 02:58:12 2007 +0000
1.2 +++ b/plugins/include/entity.inc Wed Mar 14 04:08:59 2007 +0000
1.3 @@ -18,6 +18,14 @@
1.4 #endif
1.5 #define _entity_included
1.6
1.7 +/**
1.8 + * Property types for entities.
1.9 + */
1.10 +enum PropType
1.11 +{
1.12 + Prop_Send = 0, /**< This property is networked. */
1.13 + Prop_Data = 1, /**< This property is for saved game files. */
1.14 +};
1.15
1.16 /**
1.17 * For more information on these, see the HL2SDK (public/edict.h)
1.18 @@ -300,12 +308,13 @@
1.19 * Gets a network property as an integer; wrapper around GetEntData().
1.20 *
1.21 * @param entity Edict index.
1.22 + * @param type Property type.
1.23 * @param prop Property to use.
1.24 * @param size Number of bytes to read (valid values are 1, 2, or 4).
1.25 * @return Value at the given property offset.
1.26 * @error Invalid entity or property not found.
1.27 */
1.28 -stock GetEntProp(entity, const String:prop[], size=4)
1.29 +stock GetEntProp(entity, PropType:type, const String:prop[], size=4)
1.30 {
1.31 new offs = GetEntSendPropOffs(entity, prop);
1.32 if (offs == -1)
1.33 @@ -319,12 +328,13 @@
1.34 * Sets a network property as an integer; wrapper around GetEntData().
1.35 *
1.36 * @param entity Edict index.
1.37 + * @param type Property type.
1.38 * @param prop Property to use.
1.39 * @param size Number of bytes to write (valid values are 1, 2, or 4).
1.40 * @error Invalid entity or offset out of reasonable bounds.
1.41 * @noreturn
1.42 */
1.43 -stock SetEntProp(entity, const String:prop[], value, size=4)
1.44 +stock SetEntProp(entity, PropType:type, const String:prop[], value, size=4)
1.45 {
1.46 new offs = GetEntSendPropOffs(entity, prop);
1.47 if (offs == -1)
1.48 @@ -338,11 +348,12 @@
1.49 * Gets a network property as a float; wrapper around GetEntDataFloat().
1.50 *
1.51 * @param entity Edict index.
1.52 + * @param type Property type.
1.53 * @param prop Property to use.
1.54 * @return Value at the given property offset..
1.55 * @error Invalid entity or offset out of reasonable bounds.
1.56 */
1.57 -stock Float:GetEntPropFloat(entity, const String:prop[])
1.58 +stock Float:GetEntPropFloat(entity, PropType:type, const String:prop[])
1.59 {
1.60 new offs = GetEntSendPropOffs(entity, prop);
1.61 if (offs == -1)
1.62 @@ -356,12 +367,13 @@
1.63 * Sets a network property as a float; wrapper around SetEntDataFloat().
1.64 *
1.65 * @param entity Edict index.
1.66 + * @param type Property type.
1.67 * @param prop Property to use.
1.68 * @param value Value to set.
1.69 * @noreturn
1.70 * @error Invalid entity or offset out of reasonable bounds.
1.71 */
1.72 -stock SetEntPropFloat(entity, const String:prop[], Float:value)
1.73 +stock SetEntPropFloat(entity, PropType:type, const String:prop[], Float:value)
1.74 {
1.75 new offs = GetEntSendPropOffs(entity, prop);
1.76 if (offs == -1)
1.77 @@ -375,11 +387,12 @@
1.78 * Gets a network property as a handle entity; wrapper around GetEntDataEnt().
1.79 *
1.80 * @param entity Edict index.
1.81 + * @param type Property type.
1.82 * @param prop Property to use.
1.83 * @return Entity index at the given property, or 0 if none.
1.84 * @error Invalid entity or offset out of reasonable bounds.
1.85 */
1.86 -stock GetEntPropEnt(entity, const String:prop[])
1.87 +stock GetEntPropEnt(entity, PropType:type, const String:prop[])
1.88 {
1.89 new offs = GetEntSendPropOffs(entity, prop);
1.90 if (offs == -1)
1.91 @@ -393,12 +406,13 @@
1.92 * Sets a network property as a handle entity; wrapper around SetEntDataEnt().
1.93 *
1.94 * @param entity Edict index.
1.95 + * @param type Property type.
1.96 * @param prop Property to use.
1.97 * @param other Entity index to set, or 0 to unset.
1.98 * @noreturn
1.99 * @error Invalid entity or offset out of reasonable bounds.
1.100 */
1.101 -stock SetEntPropEnt(entity, const String:prop[], other)
1.102 +stock SetEntPropEnt(entity, PropType:type, const String:prop[], other)
1.103 {
1.104 new offs = GetEntSendPropOffs(entity, prop);
1.105 if (offs == -1)
1.106 @@ -414,12 +428,13 @@
1.107 * convenience function and will work with both types.
1.108 *
1.109 * @param entity Edict index.
1.110 + * @param type Property type.
1.111 * @param prop Property to use.
1.112 * @param vec Vector buffer to store data in.
1.113 * @noreturn
1.114 * @error Invalid entity or offset out of reasonable bounds.
1.115 */
1.116 -stock GetEntPropVector(entity, const String:prop[], Float:vec[3])
1.117 +stock GetEntPropVector(entity, PropType:type, const String:prop[], Float:vec[3])
1.118 {
1.119 new offs = GetEntSendPropOffs(entity, prop);
1.120 if (offs == -1)
1.121 @@ -435,12 +450,13 @@
1.122 * convenience function and will work with both types.
1.123 *
1.124 * @param entity Edict index.
1.125 + * @param type Property type.
1.126 * @param prop Property to use.
1.127 * @param vec Vector to set.
1.128 * @noreturn
1.129 * @error Invalid entity or offset out of reasonable bounds.
1.130 */
1.131 -stock SetEntPropVector(entity, const String:prop[], const Float:vec[3])
1.132 +stock SetEntPropVector(entity, PropType:type, const String:prop[], const Float:vec[3])
1.133 {
1.134 new offs = GetEntSendPropOffs(entity, prop);
1.135 if (offs == -1)