1.1 --- a/plugins/include/entity_prop_stocks.inc Sun Dec 23 23:43:25 2007 +0000
1.2 +++ b/plugins/include/entity_prop_stocks.inc Mon Dec 24 00:44:48 2007 +0000
1.3 @@ -52,7 +52,19 @@
1.4 };
1.5
1.6 /**
1.7 - * Sets an entity's color.
1.8 + * Gets an entity's movetype.
1.9 + *
1.10 + * @param index Entity index
1.11 + * @return Movetype, see enum above
1.12 + */
1.13 +stock GetEntityMovetype(index)
1.14 +{
1.15 + new offset = GetEntSendPropOffs(index, "movetype");
1.16 + return GetEntData(index, offset, 1);
1.17 +}
1.18 +
1.19 +/**
1.20 + * Sets an entity's movetype.
1.21 *
1.22 * @param index Entity index
1.23 * @param mt Movetype, see enum above
1.24 @@ -81,4 +93,42 @@
1.25 SetEntData(index, offset + 1, g, 1, true);
1.26 SetEntData(index, offset + 2, b, 1, true);
1.27 SetEntData(index, offset + 3, a, 1, true);
1.28 +}
1.29 +
1.30 +/**
1.31 + * Gets an entity's gravity.
1.32 + *
1.33 + * @param index Entity index
1.34 + * @return Entity's m_flGravity value
1.35 + */
1.36 +stock Float:GetEntityGravity(index)
1.37 +{
1.38 + new offset = FindDataMapOffs(index, "m_flGravity");
1.39 + return GetEntDataFloat(index, offset);
1.40 +}
1.41 +
1.42 +/**
1.43 + * Sets an entity's gravity.
1.44 + *
1.45 + * @param index Entity index
1.46 + * @param amount Gravity to set. Default = 800
1.47 + * @noreturn
1.48 + */
1.49 +stock SetEntityGravity(index, Float:amount)
1.50 +{
1.51 + new offset = FindDataMapOffs(index, "m_flGravity");
1.52 + SetEntDataFloat(index, offset, amount, true);
1.53 +}
1.54 +
1.55 +/**
1.56 + * Sets an entity's health
1.57 + *
1.58 + * @param index Entity index
1.59 + * @param amount Health
1.60 + * @noreturn
1.61 + */
1.62 +stock SetEntityHealth(index, amount)
1.63 +{
1.64 + SetEntProp(client, Prop_Send, "m_iHealth", health, 1)
1.65 + SetEntProp(client, Prop_Data, "m_iHealth", health, 1)
1.66 }
1.67 \ No newline at end of file