Hi there!
I was writing a one simple plugin for a hooking +use, but stuck on the strange problem. I've tested the same code on HLDS and there was no any problems, but I'm using ReHLDS(with ReGamedll&Reunion&Reapi of the last versions) now and it seems doesn't support such kind of code, do u have any ideas how to pass this problem?
PHP Code:
new bool:ButtonPressed[MAX_PLAYERS+1];
in plugin_init():
PHP Code:
register_forward(FM_CmdStart, "CmdStart_Handler");
And here's a code:
PHP Code:
public CmdStart_Handler(id, UC_Handle){
if(!is_user_alive(id))
return FMRES_IGNORED;
static OldButton; OldButton = pev(id, pev_oldbuttons);
static NewButton; NewButton = pev(id, pev_button);
if(ButtonPressed[id] && NewButton & IN_USE)
return FMRES_IGNORED;
if(!ButtonPressed[id] && OldButton & IN_USE)
return FMRES_IGNORED;
if(OldButton & IN_USE){
server_print("Unsued");
ButtonPressed[id] = false;
}
if(NewButton & IN_USE) server_print("Used"), ButtonPressed[id] = true;
return FMRES_IGNORED;
}
I've tried to use reapi's functions such like
get_entvar(id, var_button) and get_entvar(id, var_oldbuttons), but the result was the same.
Also code smth like:
PHP Code:
if ((NewButton & IN_USE) && !(OldButton & IN_USE))
server_print("Used");
if (!(NewButton & IN_USE) && (OldButton & IN_USE))
server_print("Unsued");
Doesn't work too... . The server is clean and have no any unstandart plugins.
Also, I have amxx 1.9.0 version.
Well, thx for the attention, I hope u could help me to find the solution.