I registered the forward FM_KeyValue but it actually never got called.
I want the following function to be called when some KeyValue on an
entity, to be more precisely, a client, has changed.
Code:
public scxpm_set_displayname(id,kv)
{
client_print(0,print_chat,"DISPLAYNAME STEP 1/4")
if(get_pcvar_num(cvar_dpname))
{
client_print(0,print_chat,"DISPLAYNAME STEP 2/4")
if(pev_valid(id))
{
client_print(0,print_chat,"DISPLAYNAME STEP 3/4")
new var[128]
get_kvd(kv,KV_KeyName,var,31)
if(equali(var,"displayname"))
{
client_print(0,print_chat,"DISPLAYNAME STEP 4/4")
get_kvd(kv,KV_Value,var,31)
format(var,127,"%s^nLevel: %i^nRank: %s",var,playerlevel[id],rank[id])
forward_return(FMV_STRING,var)
return FMRES_SUPERCEDE
}
}
}
return FMRES_IGNORED
}
As "DISPLAYNAME STEP 1/4" is never being printed to console I guess this is
never being called. Note that I registered the forward in plugin_init, because
thats where to register cvars too which this function shall know about.
__________________