View Single Post
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 02-18-2020 , 09:04   Re: Difference between DispatchKeyValue() And SetEntProp()
Reply With Quote #2

SetEntProp allows you to change almost every entity property (for both net and data props).
You can dump these properties using sm_dump_netprops (also sm_dump_netprops_xml) and sm_dump_datamaps commands.
As i know DispatchKeyValue allows you to change only Key Value (entity properties marked with Key flag).

For example (from datamaps dump):
- m_iClassname (Offset 92) (Save|Key)(4 Bytes) - classname
In this case classname is the Key name and you can use DispatchKeyValue here,
m_iClassname is the property name and you must use Get/SetEntProp for this.
So, if you see Key flag (in brackets) you can propably use DispatchKeyValue.

Some properties don't have Key flag and Key name so you can't use DispatchKeyValue in this case.

Also, DispatchKeyValue used to modify only existing keys so you can use this plugin to set/get some custom keys.

So, you should use DispatchKeyValue only before spawning entities and only if property has key name (existing key).
In other cases use SetEntProp (even before DispatchSpawn).
__________________

Last edited by MAGNAT2645; 02-18-2020 at 09:11.
MAGNAT2645 is offline