commited a new version of this file. suffice to say the massive inconsistencies and clear compiling bugs in this was disappointing

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401840
This commit is contained in:
David Anderson 2008-01-06 01:35:24 +00:00
parent 1ffd1db733
commit 934fb9741a

View File

@ -80,83 +80,86 @@ enum
/** /**
* Gets an entity's movetype. * Gets an entity's movetype.
* *
* @param index Entity index * @param entity Entity index.
* @return Movetype, see enum above * @return Movetype, see enum above.
* @error Invalid entity index, or lack of mod compliance.
*/ */
stock GetEntityMovetype(index) stock GetEntityMovetype(entity)
{ {
new offset = GetEntSendPropOffs(index, "movetype"); new offset = GetEntSendPropOffs(entity, "movetype");
return GetEntData(index, offset, 1); return GetEntData(entity, offset, 1);
} }
/** /**
* Sets an entity's movetype. * Sets an entity's movetype.
* *
* @param index Entity index * @param entity Entity index.
* @param mt Movetype, see enum above * @param mt Movetype, see enum above.
* @noreturn * @noreturn
* @error Invalid entity index, or lack of mod compliance.
*/ */
stock SetEntityMovetype(index, mt) stock SetEntityMovetype(entity, mt)
{ {
new offset = GetEntSendPropOffs(index, "movetype"); new offset = GetEntSendPropOffs(entity, "movetype");
SetEntData(index, offset, mt, 1, true); SetEntData(entity, offset, mt, 1, true);
} }
/** /**
* Sets an entity's color. * Sets an entity's color.
* *
* @param index Entity index * @param entity Entity index
* @param r Amount of red (0-255) * @param r Amount of red (0-255)
* @param g Amount of green (0-255) * @param g Amount of green (0-255)
* @param b Amount of blue (0-255) * @param b Amount of blue (0-255)
* @param a Amount of alpha (0-255) * @param a Amount of alpha (0-255)
* @noreturn * @noreturn
* @error Invalid entity index, or lack of mod compliance.
*/ */
stock SetEntityRenderColor(index, r=255, g=255, b=255, a=255) stock SetEntityRenderColor(entity, r=255, g=255, b=255, a=255)
{ {
new offset = GetEntSendPropOffs(index, "m_clrRender"); new offset = GetEntSendPropOffs(entity, "m_clrRender");
SetEntData(index, offset, r, 1, true); SetEntData(entity, offset, r, 1, true);
SetEntData(index, offset + 1, g, 1, true); SetEntData(entity, offset + 1, g, 1, true);
SetEntData(index, offset + 2, b, 1, true); SetEntData(entity, offset + 2, b, 1, true);
SetEntData(index, offset + 3, a, 1, true); SetEntData(entity, offset + 3, a, 1, true);
} }
/** /**
* Gets an entity's gravity. * Gets an entity's gravity.
* *
* @param index Entity index * @param entity Entity index.
* @return Entity's m_flGravity value * @return Entity's m_flGravity value.
* @error Invalid entity index, or lack of mod compliance.
*/ */
stock Float:GetEntityGravity(index) stock Float:GetEntityGravity(entity)
{ {
new offset = FindDataMapOffs(index, "m_flGravity"); return GetEntPropFloat(entity, Prop_Data, "m_flGravity");
return GetEntDataFloat(index, offset);
} }
/** /**
* Sets an entity's gravity. * Sets an entity's gravity.
* *
* @param index Entity index * @param entity Entity index.
* @param amount Gravity to set. Default = 800 * @param amount Gravity to set (default = 800).
* @noreturn * @noreturn
* @error Invalid entity index, or lack of mod compliance.
*/ */
stock SetEntityGravity(index, Float:amount) stock SetEntityGravity(entity, Float:amount)
{ {
new offset = FindDataMapOffs(index, "m_flGravity"); SetEntPropFloat(entity, Prop_Data, "m_flGravity", amount);
SetEntDataFloat(index, offset, amount, true);
} }
/** /**
* Sets an entity's health * Sets an entity's health
* *
* @param index Entity index * @param entity Entity index.
* @param amount Health * @param amount Health amount.
* @noreturn * @noreturn
* @error Invalid entity index, or lack of mod compliance.
*/ */
stock SetEntityHealth(index, amount) stock SetEntityHealth(entity, amount)
{ {
SetEntProp(client, Prop_Send, "m_iHealth", amount, 4) SetEntProp(entity, Prop_Send, "m_iHealth", amount);
SetEntProp(client, Prop_Data, "m_iHealth", amount, 4)
} }
/** /**
@ -164,9 +167,11 @@ stock SetEntityHealth(index, amount)
* *
* @param client Client index * @param client Client index
* @return Bitsum of buttons * @return Bitsum of buttons
* @error Invalid client index, client not in game,
* or lack of mod compliance.
*/ */
stock GetClientButtons(client) stock GetClientButtons(client)
{ {
new offset = FindDataMapOffs(client, "m_nButtons"); return GetEntProp(client, Prop_Data, "m_nButtons");
return GetEntData(client, offset, 4);
} }