Raised This Month: $32 Target: $400
 8% 

Solved hook_cvar_change and RH_Cvar_DirectSet not working


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LiZou Mapper
Member
Join Date: Oct 2018
Location: Morocco
Old 06-13-2022 , 15:07   hook_cvar_change and RH_Cvar_DirectSet not working
Reply With Quote #1

Hi everyone!
I searched a lot before doing this Thread.
The problem is forward hook_cvar_change() not working.
I used RH_Cvar_DirectSet from ReAPI, It doesn't work either.

hook_cvar_change(): I changed the value in cvar, I don't see any message:

This message appears when a server is activated:
PHP Code:
L 06/13/2022 19:50:55client_disconnected and client_remove forwards have been disabled check your gamedata files.
L 06/13/2022 19:50:55Binding/Hooking cvars have been disabled check your gamedata file 
RH_Cvar_DirectSet:
PHP Code:
L 06/13/2022 19:50:57: [ReAPIRegisterHookChain: function (Cvar_DirectSetis not availableReHLDS required.
L 06/13/2022 19:50:57: [AMXXRun time error 10 (plugin "cstrike.amxx") (native "RegisterHookChain") - debug not enabled!
L 06/13/2022 19:50:57: [AMXXTo enable debug modeadd "debug" after the plugin name in plugins.ini (without quote 
Plugin:
PHP Code:
#include <amxmodx>
#include <reapi>

// Global Variables.
new g_pCvar_iValue

// Forward called after server activation.
public plugin_init()
{
    
// Load plugin.
    
register_plugin("[ZE] Set Rendering""1.0""z0h1r-LK")

    
// Hook Chains.
    
RegisterHookChain(RH_Cvar_DirectSet"fw_Cvar_DirectSet_Post"1)

    
// Cvars.
    
g_pCvar_iValue register_cvar("amx_value""1")
    
hook_cvar_change(g_pCvar_iValue"fw_CvarChange_Post")
}

// Forward called when change value from cvar "amx_value".
public fw_CvarChange_Post(pCvar, const szOldVal[], const szNewVal[])
{
    
// Print message on server console.
    
server_print("[AMXX] cvar: %d | old value: %s | new value: %s"pCvarszOldValszNewVal)
}

// Hook called when change value in any cvar.
public fw_Cvar_DirectSet_Post(pCvar, const szVal[])
{
    
// Print message on server console.
    
server_print("[ReAPI] cvar: %d | value: %d"pCvarszVal)

I use:
OS: Windows
AMX Mod X v1.10.0.5461
ReAPI v5.21.0.252-dev
MetaMod-R v1.3.0.86
ReHLDS v3.10.0.759


Please help!!
Thanks in advance
__________________

-------------
My Maps !
Zombie Escape Mod !
-------------


Last edited by LiZou Mapper; 06-19-2022 at 15:38. Reason: Update title
LiZou Mapper is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 06-13-2022 , 16:35   Re: hook_cvar_change and RH_Cvar_DirectSet not working
Reply With Quote #2

I think the logs are as clear as possible.

Code:
client_disconnected and client_remove forwards have been disabled - check your gamedata files.
Code:
RegisterHookChain: function (Cvar_DirectSet) is not available, ReHLDS required.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
LiZou Mapper
Member
Join Date: Oct 2018
Location: Morocco
Old 06-13-2022 , 17:57   Re: hook_cvar_change and RH_Cvar_DirectSet not working
Reply With Quote #3

Quote:
Originally Posted by iceeedr View Post
I think the logs are as clear as possible.

Code:
client_disconnected and client_remove forwards have been disabled - check your gamedata files.
Code:
RegisterHookChain: function (Cvar_DirectSet) is not available, ReHLDS required.
ReHLDS is exists.
The latest version of ReHLDS no longer supports Windows!

I have reviewed the gamedata, it exists
HTML Code:
"SV_DropClient" // void SV_DropClient(client_t *cl, qboolean crash, const char *fmt, ...);
{
	"library"   "engine"
	"windows"   "\x55\x8B\x2A\x81\x2A\x2A\x2A\x2A\x2A\x8B\x2A\x2A\x53\x56\x8D"
	"linux"     "@SV_DropClient"
	"mac"       "@SV_DropClient"
}
"Cvar_DirectSet" // void Cvar_DirectSet(struct cvar_s *var, char *value);
{
	"library"   "engine"
	"windows"   "\x55\x8B\x2A\x81\x2A\x2A\x2A\x2A\x2A\x56\x8B\x2A\x2A\x57\x8B\x2A\x2A\x85"
	"linux"     "@Cvar_DirectSet"
	"mac"       "@Cvar_DirectSet"
}
__________________

-------------
My Maps !
Zombie Escape Mod !
-------------

LiZou Mapper is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 06-13-2022 , 18:03   Re: hook_cvar_change and RH_Cvar_DirectSet not working
Reply With Quote #4

You can grab the latest version of rehlds for windows from github under the Actions tab (not recommended, but definitely possible) and I would redo the entire installation process to eliminate any corrupted files.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
LiZou Mapper
Member
Join Date: Oct 2018
Location: Morocco
Old 06-13-2022 , 18:55   Re: hook_cvar_change and RH_Cvar_DirectSet not working
Reply With Quote #5

Quote:
Originally Posted by iceeedr View Post
You can grab the latest version of rehlds for windows from github under the Actions tab (not recommended, but definitely possible) and I would redo the entire installation process to eliminate any corrupted files.
I got the latest version of ReHLDS from the Action tab, thanks!
But the message is still displayed on the console:
PHP Code:
[ReAPIRegisterHookChain: function (Cvar_DirectSetis not availableReHLDS required
hook_cvar_change is still not working
__________________

-------------
My Maps !
Zombie Escape Mod !
-------------


Last edited by LiZou Mapper; 06-14-2022 at 11:53.
LiZou Mapper is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode