Add "DispatchKeyValueInt" stock (#1764)

This commit is contained in:
Psykotikism
2023-08-30 22:08:45 +02:00
committed by Your Name
parent b789d30658
commit 25184aa9c7
+17
View File
@@ -169,6 +169,23 @@ native bool DispatchSpawn(int entity);
*/
native bool DispatchKeyValue(int entity, const char[] keyName, const char[] value);
/**
* Dispatches a KeyValue into given entity using an integer value.
*
* @param entity Destination entity index.
* @param keyName Name of the key.
* @param value Integer value.
* @return True on success, false otherwise.
* @error Invalid entity index or lack of mod support.
*/
stock bool DispatchKeyValueInt(int entity, const char[] keyName, int value)
{
char str[12];
FormatEx(str, sizeof(str), "%d", value);
return DispatchKeyValue(entity, keyName, str);
}
/**
* Dispatches a KeyValue into given entity using a floating point value.
*