KeyValue Event Manager

Post Reply
greenie
Full Member
Full Member
Posts: 1815
Joined: Sun Nov 21, 2021 4:55 pm
Jucator SA:MP ?: Nu
Nick:: greenie
Jucator CS ?: Nu

KeyValue Event Manager

Post by greenie »

This plugin can serve other plugins by working as an engine to inform plugins of KeyValue changes to an entity. It can highly compress the amount of code for a plugin and can serve multiple plugins. If this plugin needs to be added for another plugin's functionality, this plugin should be added at the end of plugins.ini. To author a plugin under this engine, kve.inc must be saved to ..\amxmodx\scripting\includes\
// entity_callback(const szValue[], entid, kvdid)
// worldspawn_callback(bKeyExists, const szValue[])

native register_keyvalue(szClassName[32], szKeyName[64], szFunction[32]);
#include <amxmodx>
#include <kve>
...

public plugin_precache()
{
register_keyvalue("worldspawn", "skyname", "handle_worldspawn_skyname");
register_keyvalue("game_score", "points", "handle_game_score_points");
}

public handle_worldspawn_skyname(bKeyExists, const szValue[])
{
...
}

public handle_game_score_points(const szValue[], entid, kvdid)
{
// Within here, you can change the key or value using fakemeta's set_kvd
...
}

...
get plugin
Post Reply

Return to “Technical/Development”