Skip to content

Commit

Permalink
Update rt_restrictions.sma
Browse files Browse the repository at this point in the history
* Fix wrong `rt_access` cached value at first map (1st server start)
* Add ability to set empty (access for all) value for cvar `rt_access`
  • Loading branch information
Giferns committed Oct 7, 2024
1 parent cde0d6f commit d05854b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions addons/amxmodx/scripting/rt_restrictions.sma
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ const PREVENT_FLAGS = (PLAYER_PREVENT_CLIMB|PLAYER_PREVENT_JUMP);

new g_ePlayerData[MAX_PLAYERS + 1][PlayerData];

new g_iAccessFlags;

public plugin_precache() {
CreateCvars();

Expand All @@ -52,8 +50,6 @@ public plugin_init() {
}

public plugin_cfg() {
g_iAccessFlags = read_flags(g_eCvars[ACCESS]);

if(g_eCvars[NO_MOVE] == 1)
RegisterHookChain(RG_CBasePlayer_PreThink, "CBasePlayer_PreThink_Pre");
}
Expand All @@ -72,7 +68,7 @@ public CBasePlayer_PreThink_Pre(const iPlayer) {
}

public rt_revive_start(const iEnt, const iPlayer, const iActivator, const Modes:eMode) {
if(~get_user_flags(iActivator) & g_iAccessFlags) {
if( g_eCvars[ACCESS][0] && !(get_user_flags(iActivator) & read_flags(g_eCvars[ACCESS])) ) {
NotifyClient(iActivator, print_team_red, "RT_NO_ACCESS");
return PLUGIN_HANDLED;
}
Expand Down

0 comments on commit d05854b

Please sign in to comment.