Players performing fastrevive with mouse macros? We can prevent that ?

  • Offline nntp
  • Fresh Spawn
  • *
  • Posts: 17
Hello, I got in my server lot players using mouse macros to perform fast revive with less then 1 sec to revive and auto heal. Can anyone help me to prevent that or show me directions ?

If you drink or eat something performing a revive and cancel player get a instantly revivie, doing with mouse macros, they can do that less then 1 sec.


Sorry about my english. It´s not my native language.
  • Offline soulkobk
  • Hardened
  • ****
  • Posts: 100
It can be corrected, yes.

Example, you could edit the 'FAR_defines.sqf' file and place an action holder in.

For example, something like...

Code: [Select]
#define ERR_MUTEX_LOCKED localize "STR_WL_Errors_InProgress"
if mutexScriptInProgress exitWith {hint ERR_MUTEX_LOCKED;}; \
mutexScriptInProgress = true;
#define MUTEX_UNLOCK mutexScriptInProgress = false; doCancelAction = false

Then in the script 'FAR_revive_funcs.sqf', the routine 'FAR_HandleRevive', you'd place in the command... 'MUTEX_LOCK_OR_FAIL;' at the beginning of the routine to lock it (or fail), and once the revive is either aborted or finished, place 'MUTEX_UNLOCK;' at the end of the routine to unlock it.

I use the example from above due to the DRINK and EAT functions within the player menu also using these exact functions to check whether said player is currently in an action... if they are, it fails/returns false/does nothing (see \client\inventory\mutex.sqf and/or \client\inventory\use.sqf), so it makes sense to use it within the revive functions also.

Using the same global variables/checks that the player menu has, will (should) stop any macro/player menu/revive abuse. Reviving someone, then opening player menu to eat or drink would trigger 'ERR_MUTEX_LOCKED' and fail/exit that action, so only revive would work OR eat/drink would work... but NOT BOTH at the same time.

I hope I explained myself ok... If I get time to check the latest code on github, I may code in what I wrote above and post it here.

*please note that the functions named above, related to file 'FAR_revive_funcs.sqf' may be different to the current available version on github.