Add support for setting string_t values with SetEntPropString.

Adds new AllowPooledString func to CHalfLife2 to allocate a string in the game's string pool.
Also fixes SetEntPropString using incorrect offset for nested sendprops.
This commit is contained in:
Nicholas Hastings
2015-07-02 14:47:31 -04:00
parent 93bec920cf
commit e0a83ff7b2
4 changed files with 98 additions and 17 deletions
+2 -4
View File
@@ -650,18 +650,16 @@ native GetEntPropString(entity, PropType:type, const String:prop[], String:buffe
/**
* Sets a network property as a string.
*
* This cannot set property fields of type PropField_String_T (such as "m_target").
* To set such fields, you should use DispatchKeyValue() from SDKTools.
*
* @param entity Edict index.
* @param type Property type.
* @param prop Property to use.
* @param buffer String to set.
* @param element Element # (starting from 0) if property is an array.
* @return Number of non-null bytes written.
* @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[]);
native SetEntPropString(entity, PropType:type, const String:prop[], const String:buffer[], element=0);
/**
* Retrieves the count of values that an entity property's array can store.