added request amb312

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40829
This commit is contained in:
David Anderson 2007-05-21 02:13:47 +00:00
parent 314e7097f8
commit 608a1f0d80

View File

@ -675,3 +675,43 @@ native GetEntPropString(entity, PropType:type, const String:prop[], String:buffe
* @error Invalid entity, offset out of reasonable bounds, or property is not a valid string.
*/
native SetEntPropString(entity, PropType:type, const String:prop[], const String:buffer[]);
/**
* Copies an array of cells from an entity at a given offset.
*
* @param entity Entity index.
* @param offset Offset to use.
* @param array Array to read into.
* @param arraySize Number of values to read.
* @param dataSize Size of each value in bytes (1, 2, or 4).
* @noreturn
* @error Invalid entity or offset out of reasonable bounds.
*/
stock GetEntDataArray(entity, offset, value, array[], arraySize, dataSize=4)
{
for (new i=0; i<arraySize; i++)
{
array[i] = GetEntData(entity, offset, dataSize)
}
}
/**
* Copies an array of cells to an entity at a given offset.
*
* @param entity Entity index.
* @param offset Offset to use.
* @param array Array of values to copy.
* @param arraySize Number of values to copy.
* @param dataSize Size of each value in bytes (1, 2, or 4).
* @param changeState True to set the network state as changed; false otherwise.
* @noreturn
* @error Invalid entity or offset out of reasonable bounds.
*/
stock SetEntDataArray(entity, offset, value, const array[], arraySize, dataSize=4, bool:changeState=false)
{
for (new i=0; i<arraySize; i++)
{
SetEntData(entity, offset, array[i], dataSize, changeState)
}
}