diff --git a/addons/sourcemod/scripting/MyJailbreak/Modules/Request/freekill.sp b/addons/sourcemod/scripting/MyJailbreak/Modules/Request/freekill.sp index ad34d910..9eef8356 100644 --- a/addons/sourcemod/scripting/MyJailbreak/Modules/Request/freekill.sp +++ b/addons/sourcemod/scripting/MyJailbreak/Modules/Request/freekill.sp @@ -450,7 +450,7 @@ int GetRandomAdmin() if (!IsValidClient(i, false, true)) continue; - if (!MyJailbreak_CheckVIPFlags(i, "sm_freekill_flag", gc_sAdminFlag, "sm_freekill_flag")) + if (!MyJB_CheckVIPFlags(i, "sm_freekill_flag", gc_sAdminFlag, "sm_freekill_flag")) continue; admins[adminsCount++] = i; diff --git a/addons/sourcemod/scripting/MyJailbreak/Modules/Request/heal.sp b/addons/sourcemod/scripting/MyJailbreak/Modules/Request/heal.sp index 52610b35..de6cb820 100644 --- a/addons/sourcemod/scripting/MyJailbreak/Modules/Request/heal.sp +++ b/addons/sourcemod/scripting/MyJailbreak/Modules/Request/heal.sp @@ -168,7 +168,7 @@ public void Heal_Event_RoundStart(Event event, char[] name, bool dontBroadcast) g_iHealCounter[i] = 0; g_bHealed[i] = false; - if (MyJailbreak_CheckVIPFlags(i, "sm_heal_flag", gc_sAdminFlagHeal, "sm_heal_flag")) + if (MyJB_CheckVIPFlags(i, "sm_heal_flag", gc_sAdminFlagHeal, "sm_heal_flag")) { g_iHealCounter[i] = -1; } @@ -206,7 +206,7 @@ public void Heal_OnClientPutInServer(int client) { g_iHealCounter[client] = 0; - if (MyJailbreak_CheckVIPFlags(client, "sm_heal_flag", gc_sAdminFlagHeal, "sm_heal_flag")) + if (MyJB_CheckVIPFlags(client, "sm_heal_flag", gc_sAdminFlagHeal, "sm_heal_flag")) { g_iHealCounter[client] = -1; } diff --git a/addons/sourcemod/scripting/MyJailbreak/Modules/Request/refuse.sp b/addons/sourcemod/scripting/MyJailbreak/Modules/Request/refuse.sp index 4627c59d..21042c88 100644 --- a/addons/sourcemod/scripting/MyJailbreak/Modules/Request/refuse.sp +++ b/addons/sourcemod/scripting/MyJailbreak/Modules/Request/refuse.sp @@ -188,7 +188,7 @@ public void Refuse_Event_RoundStart(Event event, char[] name, bool dontBroadcast g_bRefused[i] = false; g_bAllowRefuse = false; - if (MyJailbreak_CheckVIPFlags(i, "sm_refuse_flag", gc_sAdminFlagRefuse, "sm_refuse_flag")) + if (MyJB_CheckVIPFlags(i, "sm_refuse_flag", gc_sAdminFlagRefuse, "sm_refuse_flag")) { g_iRefuseCounter[i] = -1; } @@ -232,7 +232,7 @@ public void Refuse_OnClientPutInServer(int client) { g_iRefuseCounter[client] = 0; - if (MyJailbreak_CheckVIPFlags(client, "sm_refuse_flag", gc_sAdminFlagRefuse, "sm_refuse_flag")) + if (MyJB_CheckVIPFlags(client, "sm_refuse_flag", gc_sAdminFlagRefuse, "sm_refuse_flag")) { g_iRefuseCounter[client] = -1; } diff --git a/addons/sourcemod/scripting/MyJailbreak/Modules/Request/repeat.sp b/addons/sourcemod/scripting/MyJailbreak/Modules/Request/repeat.sp index 669c9d18..952702b1 100644 --- a/addons/sourcemod/scripting/MyJailbreak/Modules/Request/repeat.sp +++ b/addons/sourcemod/scripting/MyJailbreak/Modules/Request/repeat.sp @@ -166,7 +166,7 @@ public void Repeat_Event_RoundStart(Event event, char[] name, bool dontBroadcast g_bRepeated[i] = false; g_iRepeatCounter[i] = 0; - if (MyJailbreak_CheckVIPFlags(i, "sm_repeat_flag", gc_sAdminFlagRepeat, "sm_repeat_flag")) + if (MyJB_CheckVIPFlags(i, "sm_repeat_flag", gc_sAdminFlagRepeat, "sm_repeat_flag")) { g_iRepeatCounter[i] = -1; } @@ -210,7 +210,7 @@ public void Repeat_OnClientPutInServer(int client) { g_iRepeatCounter[client] = 0; - if (MyJailbreak_CheckVIPFlags(client, "sm_repeat_flag", gc_sAdminFlagRepeat, "sm_repeat_flag")) + if (MyJB_CheckVIPFlags(client, "sm_repeat_flag", gc_sAdminFlagRepeat, "sm_repeat_flag")) { g_iRepeatCounter[client] = -1; } diff --git a/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/backstab.sp b/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/backstab.sp index 23d5e3ae..214fe297 100644 --- a/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/backstab.sp +++ b/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/backstab.sp @@ -88,7 +88,7 @@ public Action BackStab_OnTakedamage(int victim, int &attacker, int &inflictor, f if (IsClientWarden(victim) || (IsClientDeputy(victim) && gc_bBackstabDeputy.BoolValue)) { - if (!MyJailbreak_CheckVIPFlags(victim, "sm_warden_backstab_flag", gc_sAdminFlagBackstab, "sm_warden_backstab_flag")) + if (!MyJB_CheckVIPFlags(victim, "sm_warden_backstab_flag", gc_sAdminFlagBackstab, "sm_warden_backstab_flag")) return Plugin_Continue; char sWeapon[32]; diff --git a/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/bulletsparks.sp b/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/bulletsparks.sp index 272637f8..f1ffccd6 100644 --- a/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/bulletsparks.sp +++ b/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/bulletsparks.sp @@ -71,7 +71,7 @@ public Action Command_BulletSparks(int client, int args) if (!gc_bPlugin.BoolValue || !g_bEnabled || !gc_bBulletSparks.BoolValue) return Plugin_Handled; - if (!MyJailbreak_CheckVIPFlags(client, "sm_warden_bulletsparks_flag", gc_sAdminFlagBulletSparks, "sm_warden_bulletsparks_flag")) + if (!MyJB_CheckVIPFlags(client, "sm_warden_bulletsparks_flag", gc_sAdminFlagBulletSparks, "sm_warden_bulletsparks_flag")) return Plugin_Handled; if (IsClientWarden(client) || (IsClientDeputy(client) && gc_bBulletSparksDeputy.BoolValue)) @@ -103,7 +103,7 @@ public Action BulletSparks_Event_BulletImpact(Event event, char[] sName, bool bD if (!gc_bPlugin.BoolValue || !g_bEnabled || !gc_bBulletSparks.BoolValue || !g_bBulletSparks[client]) return Plugin_Continue; - if (!MyJailbreak_CheckVIPFlags(client, "sm_warden_bulletsparks_flag", gc_sAdminFlagBulletSparks, "sm_warden_bulletsparks_flag")) + if (!MyJB_CheckVIPFlags(client, "sm_warden_bulletsparks_flag", gc_sAdminFlagBulletSparks, "sm_warden_bulletsparks_flag")) return Plugin_Continue; if (IsClientWarden(client) || (IsClientDeputy(client) && gc_bBulletSparksDeputy.BoolValue)) diff --git a/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/handcuffs.sp b/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/handcuffs.sp index 7b837def..47e6c763 100644 --- a/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/handcuffs.sp +++ b/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/handcuffs.sp @@ -508,7 +508,7 @@ void CuffsEm(int client, int attacker) CPrintToChatAll("%s %t", g_sPrefix, "warden_cuffson", attacker, client); CPrintToChat(attacker, "%s %t", g_sPrefix, "warden_cuffsgot", g_iPlayerHandCuffs[attacker]); - if (MyJailbreak_CheckVIPFlags(client, "sm_warden_handcuffs_flag", gc_sAdminFlagCuffs, "sm_warden_handcuffs_flag")) + if (MyJB_CheckVIPFlags(client, "sm_warden_handcuffs_flag", gc_sAdminFlagCuffs, "sm_warden_handcuffs_flag")) { CreateTimer (2.5, Timer_HasPaperClip, client); } diff --git a/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/laser.sp b/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/laser.sp index a35d04de..d5f7eaf6 100644 --- a/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/laser.sp +++ b/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/laser.sp @@ -76,7 +76,7 @@ public Action Command_LaserMenu(int client, int args) { if (IsClientWarden(client) || (IsClientDeputy(client) && gc_bLaserDeputy.BoolValue)) { - if (MyJailbreak_CheckVIPFlags(client, "sm_warden_laser_flag", gc_sAdminFlagLaser, "sm_warden_laser_flag")) + if (MyJB_CheckVIPFlags(client, "sm_warden_laser_flag", gc_sAdminFlagLaser, "sm_warden_laser_flag")) { char menuinfo[255]; Menu menu = new Menu(Handler_LaserMenu); @@ -146,7 +146,7 @@ public Action Laser_OnPlayerRunCmd(int client, int &buttons, int &impulse, float if (!IsValidClient(client, true, true)) return Plugin_Continue; - if (!MyJailbreak_CheckVIPFlags(client, "sm_warden_laser_flag", gc_sAdminFlagLaser, "sm_warden_laser_flag")) + if (!MyJB_CheckVIPFlags(client, "sm_warden_laser_flag", gc_sAdminFlagLaser, "sm_warden_laser_flag")) return Plugin_Continue; // g_bLaserUse[client] = true; diff --git a/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/mute.sp b/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/mute.sp index fc05f863..3944b8f4 100644 --- a/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/mute.sp +++ b/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/mute.sp @@ -210,7 +210,7 @@ public void Mute_Event_RoundStart(Event event, const char[] name, bool dontBroad if (!IsValidClient(i, true, true)) continue; - if (MyJailbreak_CheckVIPFlags(i, "sm_warden_mute_immuntiy", gc_sAdminFlagMute, "sm_warden_mute_immuntiy")) + if (MyJB_CheckVIPFlags(i, "sm_warden_mute_immuntiy", gc_sAdminFlagMute, "sm_warden_mute_immuntiy")) continue; if (GetClientTeam(i) != CS_TEAM_CT) @@ -252,7 +252,7 @@ public void OnClientSpeakingEx(int client) if (!IsValidClient(i, true, true)) continue; - if (MyJailbreak_CheckVIPFlags(i, "sm_warden_mute_immuntiy", gc_sAdminFlagMute, "sm_warden_mute_immuntiy")) + if (MyJB_CheckVIPFlags(i, "sm_warden_mute_immuntiy", gc_sAdminFlagMute, "sm_warden_mute_immuntiy")) continue; if ((GetClientTeam(i) != CS_TEAM_CT) && (!g_bIsMuted[i] || (GetClientListeningFlags(i) != VOICE_MUTED)) || @@ -316,7 +316,7 @@ void MuteClient(int client, int time, int muter) if (!IsValidClient(client, true, true)) return; - if (MyJailbreak_CheckVIPFlags(client, "sm_warden_mute_immuntiy", gc_sAdminFlagMute, "sm_warden_mute_immuntiy")) + if (MyJB_CheckVIPFlags(client, "sm_warden_mute_immuntiy", gc_sAdminFlagMute, "sm_warden_mute_immuntiy")) return; if (GetClientTeam(client) != CS_TEAM_CT) @@ -407,7 +407,7 @@ void MuteMenuPlayer(int client) if (!IsValidClient(i, true, true)) continue; - if (MyJailbreak_CheckVIPFlags(i, "sm_warden_mute_immuntiy", gc_sAdminFlagMute, "sm_warden_mute_immuntiy")) + if (MyJB_CheckVIPFlags(i, "sm_warden_mute_immuntiy", gc_sAdminFlagMute, "sm_warden_mute_immuntiy")) continue; if ((GetClientTeam(i) != CS_TEAM_CT) && !g_bIsMuted[i]) diff --git a/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/painter.sp b/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/painter.sp index 58a4b0d1..610d5ea7 100644 --- a/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/painter.sp +++ b/addons/sourcemod/scripting/MyJailbreak/Modules/Warden/painter.sp @@ -90,7 +90,7 @@ public Action Command_PainterMenu(int client, int args) { if ((IsClientWarden(client)) || (IsClientDeputy(client) && gc_bPainterDeputy.BoolValue) || ((GetClientTeam(client) == CS_TEAM_T) && g_bPainterT)) { - if (MyJailbreak_CheckVIPFlags(client, "sm_warden_painter_flag", gc_sAdminFlagPainter, "sm_warden_painter_flag") || (GetClientTeam(client) == CS_TEAM_T)) + if (MyJB_CheckVIPFlags(client, "sm_warden_painter_flag", gc_sAdminFlagPainter, "sm_warden_painter_flag") || (GetClientTeam(client) == CS_TEAM_T)) { char menuinfo[255]; @@ -181,7 +181,7 @@ public Action Painter_OnPlayerRunCmd(int client, int &buttons, int &impulse, flo if (!IsPlayerAlive(client)) return; - if ((IsClientWarden(client) && gc_bPainter.BoolValue && g_bPainter[client] && MyJailbreak_CheckVIPFlags(client, "sm_warden_painter_flag", gc_sAdminFlagPainter, "sm_warden_painter_flag")) || ((GetClientTeam(client) == CS_TEAM_T) && gc_bPainter.BoolValue && g_bPainterT && g_bPainter[client]) || (IsClientDeputy(client) && gc_bPainterDeputy.BoolValue && g_bPainter[client])) + if ((IsClientWarden(client) && gc_bPainter.BoolValue && g_bPainter[client] && MyJB_CheckVIPFlags(client, "sm_warden_painter_flag", gc_sAdminFlagPainter, "sm_warden_painter_flag")) || ((GetClientTeam(client) == CS_TEAM_T) && gc_bPainter.BoolValue && g_bPainterT && g_bPainter[client]) || (IsClientDeputy(client) && gc_bPainterDeputy.BoolValue && g_bPainter[client])) { for (int i = 0; i < MAX_BUTTONS; i++) { diff --git a/addons/sourcemod/scripting/MyJailbreak/armsrace.sp b/addons/sourcemod/scripting/MyJailbreak/armsrace.sp index c1d3512f..223bc9fa 100644 --- a/addons/sourcemod/scripting/MyJailbreak/armsrace.sp +++ b/addons/sourcemod/scripting/MyJailbreak/armsrace.sp @@ -373,7 +373,7 @@ public Action Command_Setarmsrace(int client, int args) LogToFileEx(g_sEventsLogFile, "Event armsrace was started by groupvoting"); } } - else if (MyJailbreak_CheckVIPFlags(client, "sm_armsrace_flag", gc_sAdminFlag, "sm_armsrace_flag")) // Called by admin/VIP + else if (MyJB_CheckVIPFlags(client, "sm_armsrace_flag", gc_sAdminFlag, "sm_armsrace_flag")) // Called by admin/VIP { if (!gc_bSetA.BoolValue) { @@ -1301,3 +1301,19 @@ public Action CS_OnTerminateRound(float &delay, CSRoundEndReason &reason) return Plugin_Handled; } + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); +} \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/catch.sp b/addons/sourcemod/scripting/MyJailbreak/catch.sp index b3d62c02..638bc842 100644 --- a/addons/sourcemod/scripting/MyJailbreak/catch.sp +++ b/addons/sourcemod/scripting/MyJailbreak/catch.sp @@ -488,7 +488,7 @@ public Action Command_SetCatch(int client, int args) LogToFileEx(g_sEventsLogFile, "Event Catch was started by groupvoting"); } } - else if (MyJailbreak_CheckVIPFlags(client, "sm_catch_flag", gc_sAdminFlag, "sm_catch_flag")) // Called by admin/VIP + else if (MyJB_CheckVIPFlags(client, "sm_catch_flag", gc_sAdminFlag, "sm_catch_flag")) // Called by admin/VIP { if (!gc_bSetA.BoolValue) { @@ -1656,4 +1656,20 @@ public void Event_PlayerSpawn(Event event, const char[] name, bool dontBroadcast ResetSprint(client); g_iSprintStatus[client] &= ~ IsSprintCoolDown; +} + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); } \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/cowboy.sp b/addons/sourcemod/scripting/MyJailbreak/cowboy.sp index 0b6f97f3..68aaa630 100644 --- a/addons/sourcemod/scripting/MyJailbreak/cowboy.sp +++ b/addons/sourcemod/scripting/MyJailbreak/cowboy.sp @@ -414,7 +414,7 @@ public Action Command_SetCowBoy(int client, int args) LogToFileEx(g_sEventsLogFile, "Event CowBoy was started by groupvoting"); } } - else if (MyJailbreak_CheckVIPFlags(client, "sm_cowboy_flag", gc_sAdminFlag, "sm_cowboy_flag")) // Called by admin/VIP + else if (MyJB_CheckVIPFlags(client, "sm_cowboy_flag", gc_sAdminFlag, "sm_cowboy_flag")) // Called by admin/VIP { if (!gc_bSetA.BoolValue) { @@ -1193,4 +1193,20 @@ public Action Timer_Hitsound(Handle timer, Handle data) if (attacker <= 0 || attacker > MaxClients || victim <= 0 || victim > MaxClients || attacker == victim) return; ClientCommand(attacker, "playgamesound training/bell_normal.wav"); +} + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); } \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/dealdamage.sp b/addons/sourcemod/scripting/MyJailbreak/dealdamage.sp index b502bfb7..13266f5f 100644 --- a/addons/sourcemod/scripting/MyJailbreak/dealdamage.sp +++ b/addons/sourcemod/scripting/MyJailbreak/dealdamage.sp @@ -495,7 +495,7 @@ public Action Command_SetDealDamage(int client, int args) LogToFileEx(g_sEventsLogFile, "Event Deal Damage was started by groupvoting"); } } - else if (MyJailbreak_CheckVIPFlags(client, "sm_dealdamage_flag", gc_sAdminFlag, "sm_dealdamage_flag")) // Called by admin/VIP + else if (MyJB_CheckVIPFlags(client, "sm_dealdamage_flag", gc_sAdminFlag, "sm_dealdamage_flag")) // Called by admin/VIP { if (!gc_bSetA.BoolValue) { @@ -1591,3 +1591,19 @@ public Action Timer_Overlay(Handle timer, int client) } } } + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); +} \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/drunk.sp b/addons/sourcemod/scripting/MyJailbreak/drunk.sp index 7ee32bc3..7e4f76d4 100644 --- a/addons/sourcemod/scripting/MyJailbreak/drunk.sp +++ b/addons/sourcemod/scripting/MyJailbreak/drunk.sp @@ -381,7 +381,7 @@ public Action Command_SetDrunk(int client, int args) LogToFileEx(g_sEventsLogFile, "Event Drunk was started by groupvoting"); } } - else if (MyJailbreak_CheckVIPFlags(client, "sm_drunk_flag", gc_sAdminFlag, "sm_drunk_flag")) // Called by admin/VIP + else if (MyJB_CheckVIPFlags(client, "sm_drunk_flag", gc_sAdminFlag, "sm_drunk_flag")) // Called by admin/VIP { if (!gc_bSetA.BoolValue) { @@ -1165,4 +1165,20 @@ public Action Timer_Drunk(Handle timer, int userid) } return Plugin_Handled; +} + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); } \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/duckhunt.sp b/addons/sourcemod/scripting/MyJailbreak/duckhunt.sp index 3e2c002a..680cc2e9 100644 --- a/addons/sourcemod/scripting/MyJailbreak/duckhunt.sp +++ b/addons/sourcemod/scripting/MyJailbreak/duckhunt.sp @@ -410,7 +410,7 @@ public Action Command_SetDuckHunt(int client, int args) LogToFileEx(g_sEventsLogFile, "Event duckhunt was started by groupvoting"); } } - else if (MyJailbreak_CheckVIPFlags(client, "sm_duckhunt_flag", gc_sAdminFlag, "sm_duckhunt_flag")) // Called by admin/VIP + else if (MyJB_CheckVIPFlags(client, "sm_duckhunt_flag", gc_sAdminFlag, "sm_duckhunt_flag")) // Called by admin/VIP { if (!gc_bSetA.BoolValue) { @@ -1412,4 +1412,20 @@ public Action Timer_BeaconOn(Handle timer) } g_hTimerBeacon = null; +} + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); } \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/ffa.sp b/addons/sourcemod/scripting/MyJailbreak/ffa.sp index d349a51a..3efb42ae 100644 --- a/addons/sourcemod/scripting/MyJailbreak/ffa.sp +++ b/addons/sourcemod/scripting/MyJailbreak/ffa.sp @@ -373,7 +373,7 @@ public Action Command_Setffa(int client, int args) LogToFileEx(g_sEventsLogFile, "Event ffa was started by groupvoting"); } } - else if (MyJailbreak_CheckVIPFlags(client, "sm_ffa_flag", gc_sAdminFlag, "sm_ffa_flag")) // Called by admin/VIP + else if (MyJB_CheckVIPFlags(client, "sm_ffa_flag", gc_sAdminFlag, "sm_ffa_flag")) // Called by admin/VIP { if (!gc_bSetA.BoolValue) { @@ -1088,4 +1088,20 @@ public Action Timer_BeaconOn(Handle timer) } g_hTimerBeacon = null; +} + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); } \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/freeday.sp b/addons/sourcemod/scripting/MyJailbreak/freeday.sp index 3499c70e..af99c170 100644 --- a/addons/sourcemod/scripting/MyJailbreak/freeday.sp +++ b/addons/sourcemod/scripting/MyJailbreak/freeday.sp @@ -322,7 +322,7 @@ public Action Command_SetFreeday(int client, int args) LogToFileEx(g_sEventsLogFile, "Event Freeday was started by groupvoting"); } } - else if (MyJailbreak_CheckVIPFlags(client, "sm_freeday_flag", gc_sAdminFlag, "sm_freeday_flag")) // Called by admin/VIP + else if (MyJB_CheckVIPFlags(client, "sm_freeday_flag", gc_sAdminFlag, "sm_freeday_flag")) // Called by admin/VIP { if (!gc_bSetA.BoolValue) { @@ -882,3 +882,19 @@ public Action Timer_Respawn(Handle timer, int userid) return Plugin_Handled; } + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); +} \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/ghosts.sp b/addons/sourcemod/scripting/MyJailbreak/ghosts.sp index c426f8da..322b3a44 100644 --- a/addons/sourcemod/scripting/MyJailbreak/ghosts.sp +++ b/addons/sourcemod/scripting/MyJailbreak/ghosts.sp @@ -387,7 +387,7 @@ public Action Command_SetGhosts(int client, int args) LogToFileEx(g_sEventsLogFile, "Event Ghosts was started by groupvoting"); } } - else if (MyJailbreak_CheckVIPFlags(client, "sm_ghosts_flag", gc_sAdminFlag, "sm_ghosts_flag")) // Called by admin/VIP + else if (MyJB_CheckVIPFlags(client, "sm_ghosts_flag", gc_sAdminFlag, "sm_ghosts_flag")) // Called by admin/VIP { if (!gc_bSetA.BoolValue) { @@ -1173,4 +1173,20 @@ public Action Timer_BeaconOn(Handle timer) } g_hTimerBeacon = null; +} + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); } \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/hebattle.sp b/addons/sourcemod/scripting/MyJailbreak/hebattle.sp index b9567c21..a4856c5f 100644 --- a/addons/sourcemod/scripting/MyJailbreak/hebattle.sp +++ b/addons/sourcemod/scripting/MyJailbreak/hebattle.sp @@ -401,7 +401,7 @@ public Action Command_SetHEbattle(int client, int args) LogToFileEx(g_sEventsLogFile, "Event HE Battle was started by groupvoting"); } } - else if (MyJailbreak_CheckVIPFlags(client, "sm_hebattle_flag", gc_sAdminFlag, "sm_hebattle_flag")) // Called by admin/VIP + else if (MyJB_CheckVIPFlags(client, "sm_hebattle_flag", gc_sAdminFlag, "sm_hebattle_flag")) // Called by admin/VIP { if (!gc_bSetA.BoolValue) { @@ -1191,4 +1191,20 @@ public Action Timer_CheckGravity(Handle timer) SetEntityGravity(i, gc_fGravValue.FloatValue); } } +} + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); } \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/hide.sp b/addons/sourcemod/scripting/MyJailbreak/hide.sp index 2ebc07a3..4622141f 100644 --- a/addons/sourcemod/scripting/MyJailbreak/hide.sp +++ b/addons/sourcemod/scripting/MyJailbreak/hide.sp @@ -430,7 +430,7 @@ public Action Command_SetHide(int client, int args) LogToFileEx(g_sEventsLogFile, "Event Hide was started by groupvoting"); } } - else if (MyJailbreak_CheckVIPFlags(client, "sm_hide_flag", gc_sAdminFlag, "sm_hide_flag")) // Called by admin/VIP + else if (MyJB_CheckVIPFlags(client, "sm_hide_flag", gc_sAdminFlag, "sm_hide_flag")) // Called by admin/VIP { if (!gc_bSetA.BoolValue) { @@ -1424,3 +1424,19 @@ public Action Timer_SlayClient(Handle timer, int userid) ForcePlayerSuicide(client); return Plugin_Stop; } + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); +} \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/knife.sp b/addons/sourcemod/scripting/MyJailbreak/knife.sp index 8120eea5..46fa88fb 100644 --- a/addons/sourcemod/scripting/MyJailbreak/knife.sp +++ b/addons/sourcemod/scripting/MyJailbreak/knife.sp @@ -417,7 +417,7 @@ public Action Command_SetKnifeFight(int client, int args) LogToFileEx(g_sEventsLogFile, "Event Knife Fight was started by groupvoting"); } } - else if (MyJailbreak_CheckVIPFlags(client, "sm_knifefight_flag", gc_sAdminFlag, "sm_knifefight_flag")) // Called by admin/VIP + else if (MyJB_CheckVIPFlags(client, "sm_knifefight_flag", gc_sAdminFlag, "sm_knifefight_flag")) // Called by admin/VIP { if (!gc_bSetA.BoolValue) { @@ -1238,4 +1238,20 @@ public Action Timer_BeaconOn(Handle timer) } g_hTimerBeacon = null; +} + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); } \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/menu.sp b/addons/sourcemod/scripting/MyJailbreak/menu.sp index e3dff9e6..3c8cb6d0 100644 --- a/addons/sourcemod/scripting/MyJailbreak/menu.sp +++ b/addons/sourcemod/scripting/MyJailbreak/menu.sp @@ -51,6 +51,7 @@ // Booleans bool g_bIsLateLoad; bool gp_bMyJailShop; +bool gp_bMyJailbreak; bool gp_bSmartJailDoors; bool gp_bMyWeapons; @@ -448,6 +449,7 @@ public void OnAllPluginsLoaded() gp_bWarden = LibraryExists("warden"); gp_bMyJBWarden = LibraryExists("myjbwarden"); gp_bSmartJailDoors = LibraryExists("smartjaildoors"); + gp_bMyJailbreak = LibraryExists("myjailbreak"); gp_bMyJailShop = LibraryExists("myjailshop"); gp_bMyWeapons = LibraryExists("myweapons"); } @@ -474,6 +476,10 @@ public void OnLibraryRemoved(const char[] name) { gp_bMyWeapons = false; } + else if (StrEqual(name, "myjailbreak")) + { + gp_bMyJailbreak = false; + } } public void OnLibraryAdded(const char[] name) @@ -498,6 +504,10 @@ public void OnLibraryAdded(const char[] name) { gp_bMyWeapons = true; } + else if (StrEqual(name, "myjailbreak")) + { + gp_bMyJailbreak = true; + } } // FindConVar @@ -793,7 +803,7 @@ public Action Command_OpenMenu(int client, int args) if (g_bSparks != null) { - if (g_bSparks.BoolValue && MyJailbreak_CheckVIPFlags(client, "sm_warden_bulletsparks_flag", gc_sAdminFlagBulletSparks, "sm_warden_bulletsparks_flag")) + if (g_bSparks.BoolValue && MyJB_CheckVIPFlags(client, "sm_warden_bulletsparks_flag", gc_sAdminFlagBulletSparks, "sm_warden_bulletsparks_flag")) { Format(menuinfo, sizeof(menuinfo), "%T", "menu_sparks", client); mainmenu.AddItem("sparks", menuinfo); @@ -802,7 +812,7 @@ public Action Command_OpenMenu(int client, int args) if (g_bPainter != null) { - if (g_bPainter.BoolValue && MyJailbreak_CheckVIPFlags(client, "sm_warden_painter_flag", gc_sAdminFlagPainter, "sm_warden_painter_flag")) + if (g_bPainter.BoolValue && MyJB_CheckVIPFlags(client, "sm_warden_painter_flag", gc_sAdminFlagPainter, "sm_warden_painter_flag")) { Format(menuinfo, sizeof(menuinfo), "%T", "menu_painter", client); mainmenu.AddItem("painter", menuinfo); @@ -811,7 +821,7 @@ public Action Command_OpenMenu(int client, int args) if (g_bLaser != null) { - if (g_bLaser.BoolValue && MyJailbreak_CheckVIPFlags(client, "sm_warden_laser_flag", gc_sAdminFlagLaser, "sm_warden_laser_flag")) + if (g_bLaser.BoolValue && MyJB_CheckVIPFlags(client, "sm_warden_laser_flag", gc_sAdminFlagLaser, "sm_warden_laser_flag")) { Format(menuinfo, sizeof(menuinfo), "%T", "menu_laser", client); mainmenu.AddItem("laser", menuinfo); @@ -981,7 +991,7 @@ public Action Command_OpenMenu(int client, int args) if (g_bSparks != null) { - if (g_bSparks.BoolValue && g_bSparksDeputy.BoolValue && MyJailbreak_CheckVIPFlags(client, "sm_warden_bulletsparks_flag", gc_sAdminFlagBulletSparks, "sm_warden_bulletsparks_flag")) + if (g_bSparks.BoolValue && g_bSparksDeputy.BoolValue && MyJB_CheckVIPFlags(client, "sm_warden_bulletsparks_flag", gc_sAdminFlagBulletSparks, "sm_warden_bulletsparks_flag")) { Format(menuinfo, sizeof(menuinfo), "%T", "menu_sparks", client); mainmenu.AddItem("sparks", menuinfo); @@ -990,7 +1000,7 @@ public Action Command_OpenMenu(int client, int args) if (g_bPainter != null) { - if (g_bPainter.BoolValue && g_bPainterDeputy.BoolValue && MyJailbreak_CheckVIPFlags(client, "sm_warden_painter_flag", gc_sAdminFlagPainter, "sm_warden_painter_flag")) + if (g_bPainter.BoolValue && g_bPainterDeputy.BoolValue && MyJB_CheckVIPFlags(client, "sm_warden_painter_flag", gc_sAdminFlagPainter, "sm_warden_painter_flag")) { Format(menuinfo, sizeof(menuinfo), "%T", "menu_painter", client); mainmenu.AddItem("painter", menuinfo); @@ -999,7 +1009,7 @@ public Action Command_OpenMenu(int client, int args) if (g_bLaser != null) { - if (g_bLaser.BoolValue && g_bLaserDeputy.BoolValue && MyJailbreak_CheckVIPFlags(client, "sm_warden_laser_flag", gc_sAdminFlagLaser, "sm_warden_laser_flag")) + if (g_bLaser.BoolValue && g_bLaserDeputy.BoolValue && MyJB_CheckVIPFlags(client, "sm_warden_laser_flag", gc_sAdminFlagLaser, "sm_warden_laser_flag")) { Format(menuinfo, sizeof(menuinfo), "%T", "menu_laser", client); mainmenu.AddItem("laser", menuinfo); @@ -1246,7 +1256,7 @@ public Action Command_OpenMenu(int client, int args) } } - if (MyJailbreak_CheckVIPFlags(client, "sm_menu_flag", gc_sAdminFlag, "sm_menu_flag")) + if (MyJB_CheckVIPFlags(client, "sm_menu_flag", gc_sAdminFlag, "sm_menu_flag")) { /* ADMIN PLACEHOLDER Format(menuinfo, sizeof(menuinfo), "%T", "menu_PLACEHOLDER", client); @@ -1632,7 +1642,7 @@ public int VoteEventMenuHandler(Menu daysmenu, MenuAction action, int client, in // Event Days Set Menu public Action Command_SetEventDay(int client, int args) { - if (MyJailbreak_CheckVIPFlags(client, "sm_menu_flag", gc_sAdminFlag, "sm_menu_flag")) + if (MyJB_CheckVIPFlags(client, "sm_menu_flag", gc_sAdminFlag, "sm_menu_flag")) { Command_SetAdminEventDay(client); } @@ -1762,7 +1772,7 @@ public Action Command_VotingMenu(int client, int args) { if (gc_bPlugin.BoolValue && gc_bVoting.BoolValue) { - if (((gp_bWarden || gp_bMyJBWarden) && warden_iswarden(client) && gc_bSetW.BoolValue) || (MyJailbreak_CheckVIPFlags(client, "sm_menu_flag", gc_sAdminFlag, "sm_menu_flag") && gc_bSetA.BoolValue) || client == 0) + if (((gp_bWarden || gp_bMyJBWarden) && warden_iswarden(client) && gc_bSetW.BoolValue) || (MyJB_CheckVIPFlags(client, "sm_menu_flag", gc_sAdminFlag, "sm_menu_flag") && gc_bSetA.BoolValue) || client == 0) { if ((GetTeamClientCount(CS_TEAM_CT) > 0) && (GetTeamClientCount(CS_TEAM_T) > 0)) { @@ -1886,4 +1896,20 @@ public Action Timer_WelcomeMessage(Handle timer, int userid) { CPrintToChat(client, "%s %t", g_sPrefix, "menu_info"); } +} + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); } \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/noscope.sp b/addons/sourcemod/scripting/MyJailbreak/noscope.sp index 21e8dbfa..58e2a725 100644 --- a/addons/sourcemod/scripting/MyJailbreak/noscope.sp +++ b/addons/sourcemod/scripting/MyJailbreak/noscope.sp @@ -402,7 +402,7 @@ public Action Command_SetNoScope(int client, int args) LogToFileEx(g_sEventsLogFile, "Event No Scope was started by groupvoting"); } } - else if (MyJailbreak_CheckVIPFlags(client, "sm_noscope_flag", gc_sAdminFlag, "sm_noscope_flag")) // Called by admin/VIP + else if (MyJB_CheckVIPFlags(client, "sm_noscope_flag", gc_sAdminFlag, "sm_noscope_flag")) // Called by admin/VIP { if (!gc_bSetA.BoolValue) { @@ -1253,4 +1253,20 @@ public Action Timer_BeaconOn(Handle timer) } g_hTimerBeacon = null; +} + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); } \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/oneinthechamber.sp b/addons/sourcemod/scripting/MyJailbreak/oneinthechamber.sp index 82cd6d04..11849f12 100644 --- a/addons/sourcemod/scripting/MyJailbreak/oneinthechamber.sp +++ b/addons/sourcemod/scripting/MyJailbreak/oneinthechamber.sp @@ -397,7 +397,7 @@ public Action Command_SetOITC(int client, int args) LogToFileEx(g_sEventsLogFile, "Event OneInTheChamber was started by groupvoting"); } } - else if (MyJailbreak_CheckVIPFlags(client, "sm_oneinthechamber_flag", gc_sAdminFlag, "sm_oneinthechamber_flag")) // Called by admin/VIP + else if (MyJB_CheckVIPFlags(client, "sm_oneinthechamber_flag", gc_sAdminFlag, "sm_oneinthechamber_flag")) // Called by admin/VIP { if (!gc_bSetA.BoolValue) { @@ -1194,4 +1194,20 @@ public Action Timer_GiveAmmo(Handle timer, int userid) } return Plugin_Handled; +} + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); } \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/ratio.sp b/addons/sourcemod/scripting/MyJailbreak/ratio.sp index e71efa6a..e969dc5e 100644 --- a/addons/sourcemod/scripting/MyJailbreak/ratio.sp +++ b/addons/sourcemod/scripting/MyJailbreak/ratio.sp @@ -81,6 +81,7 @@ bool g_bQueueCooldown[MAXPLAYERS+1] = {false, ...}; bool g_bEnableGuard[MAXPLAYERS+1] = {true, ...}; bool gp_bWarden = false; +bool gp_bMyJailbreak = false; bool gp_bMyJBWarden = false; // Handles @@ -346,6 +347,7 @@ public void OnAllPluginsLoaded() { gp_bMyJBWarden = LibraryExists("myjbwarden"); gp_bWarden = LibraryExists("warden"); + gp_bMyJailbreak = LibraryExists("myjailbreak"); } public void OnLibraryRemoved(const char[] name) @@ -358,6 +360,10 @@ public void OnLibraryRemoved(const char[] name) { gp_bWarden = false; } + else if (StrEqual(name, "myjailbreak")) + { + gp_bMyJailbreak = false; + } } public void OnLibraryAdded(const char[] name) @@ -370,6 +376,10 @@ public void OnLibraryAdded(const char[] name) { gp_bWarden = true; } + else if (StrEqual(name, "myjailbreak")) + { + gp_bMyJailbreak = true; + } } /****************************************************************************** @@ -520,7 +530,7 @@ public Action Command_JoinGuardQueue(int client, int iArgNum) if (iIndex == -1) { - if ((gc_iJoinMode.IntValue == 0) || (gc_bAdminBypass.BoolValue && MyJailbreak_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag"))) + if ((gc_iJoinMode.IntValue == 0) || (gc_bAdminBypass.BoolValue && MyJB_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag"))) { AddToQueue(client); } @@ -538,7 +548,7 @@ public Action Command_JoinGuardQueue(int client, int iArgNum) { CReplyToCommand(client, "%s %t", g_sPrefix, "ratio_number", iIndex + 1); - if (gc_bAdsVIP.BoolValue && gc_bVIPQueue.BoolValue && !MyJailbreak_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag")) + if (gc_bAdsVIP.BoolValue && gc_bVIPQueue.BoolValue && !MyJB_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag")) { CReplyToCommand(client, "%s %t", g_sPrefix, "ratio_advip"); } @@ -547,7 +557,7 @@ public Action Command_JoinGuardQueue(int client, int iArgNum) return Plugin_Handled; } - if ((gc_iJoinMode.IntValue == 0) || (gc_bAdminBypass.BoolValue && MyJailbreak_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag"))) + if ((gc_iJoinMode.IntValue == 0) || (gc_bAdminBypass.BoolValue && MyJB_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag"))) { if (gc_bRespawn.BoolValue) { @@ -564,7 +574,7 @@ public Action Command_JoinGuardQueue(int client, int iArgNum) if (iIndex == -1) { - if (gc_bVIPQueue.BoolValue && MyJailbreak_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag")) + if (gc_bVIPQueue.BoolValue && MyJB_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag")) { if (iQueueSize == 0) { @@ -595,7 +605,7 @@ public Action Command_JoinGuardQueue(int client, int iArgNum) { CReplyToCommand(client, "%s %t", g_sPrefix, "ratio_number", iIndex + 1); - if (gc_bAdsVIP.BoolValue && gc_bVIPQueue.BoolValue && !MyJailbreak_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag")) + if (gc_bAdsVIP.BoolValue && gc_bVIPQueue.BoolValue && !MyJB_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag")) { CReplyToCommand(client, "%s %t", g_sPrefix, "ratio_advip"); } @@ -667,7 +677,7 @@ public Action AdminCommand_ClearQueue(int client, int args) public Action Command_ToggleRatio(int client, int args) { - if (gc_bToggle.BoolValue && MyJailbreak_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag")) + if (gc_bToggle.BoolValue && MyJB_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag")) { if (g_bRatioEnable) { @@ -759,7 +769,7 @@ public Action Event_OnFullConnect(Event event, const char[] name, bool dontBroad if (!gc_bForceTConnect.BoolValue || !g_bRatioEnable) return Plugin_Continue; - if (!gc_bAdminBypass.BoolValue || !MyJailbreak_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag")) + if (!gc_bAdminBypass.BoolValue || !MyJB_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag")) { CreateTimer(1.0, Timer_ForceTSide, GetClientUserId(client)); } @@ -859,7 +869,7 @@ public Action Event_OnJoinTeam(int client, const char[] szCommand, int iArgCount if (iIndex == -1) { - if ((gc_iJoinMode.IntValue == 0) || (gc_bAdminBypass.BoolValue && MyJailbreak_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag"))) + if ((gc_iJoinMode.IntValue == 0) || (gc_bAdminBypass.BoolValue && MyJB_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag"))) { AddToQueue(client); } @@ -878,7 +888,7 @@ public Action Event_OnJoinTeam(int client, const char[] szCommand, int iArgCount { CPrintToChat(client, "%s %t", g_sPrefix, "ratio_fullqueue", iIndex + 1); - if (gc_bAdsVIP.BoolValue && gc_bVIPQueue.BoolValue && !MyJailbreak_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag")) + if (gc_bAdsVIP.BoolValue && gc_bVIPQueue.BoolValue && !MyJB_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag")) { CPrintToChat(client, "%s %t", g_sPrefix, "ratio_advip"); } @@ -887,7 +897,7 @@ public Action Event_OnJoinTeam(int client, const char[] szCommand, int iArgCount return Plugin_Handled; } - if ((gc_iJoinMode.IntValue == 0) || (gc_bAdminBypass.BoolValue && MyJailbreak_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag"))) + if ((gc_iJoinMode.IntValue == 0) || (gc_bAdminBypass.BoolValue && MyJB_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag"))) { return Plugin_Continue; } @@ -927,7 +937,7 @@ void AddToQueue(int client) if (iIndex == -1) { - if (gc_bVIPQueue.BoolValue && MyJailbreak_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag")) + if (gc_bVIPQueue.BoolValue && MyJB_CheckVIPFlags(client, "sm_ratio_flag", gc_sAdminFlag, "sm_ratio_flag")) { if (iQueueSize == 0) iIndex = PushArrayCell(g_aGuardQueue, client); @@ -1700,3 +1710,19 @@ public int ChangeMenu(Menu menu, MenuAction action, int client, int selection) delete menu; } } + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); +} \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/request.sp b/addons/sourcemod/scripting/MyJailbreak/request.sp index 98ad6bb0..b2579b52 100644 --- a/addons/sourcemod/scripting/MyJailbreak/request.sp +++ b/addons/sourcemod/scripting/MyJailbreak/request.sp @@ -428,4 +428,20 @@ public Action Timer_IsRequest(Handle timer) g_bFreeKilled[i] = false; } +} + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailBreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); } \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/suicide.sp b/addons/sourcemod/scripting/MyJailbreak/suicide.sp index 336555f5..c752036a 100644 --- a/addons/sourcemod/scripting/MyJailbreak/suicide.sp +++ b/addons/sourcemod/scripting/MyJailbreak/suicide.sp @@ -435,7 +435,7 @@ public Action Command_SetSuicideBomber(int client, int args) LogToFileEx(g_sEventsLogFile, "Event Hide was started by groupvoting"); } } - else if (MyJailbreak_CheckVIPFlags(client, "sm_suicidebomber_flag", gc_sAdminFlag, "sm_suicidebomber_flag")) // Called by admin/VIP + else if (MyJB_CheckVIPFlags(client, "sm_suicidebomber_flag", gc_sAdminFlag, "sm_suicidebomber_flag")) // Called by admin/VIP { if (!gc_bSetA.BoolValue) { @@ -1466,3 +1466,19 @@ public void Event_PlayerSpawn(Event event, const char[] name, bool dontBroadcast return; } + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); +} \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/teleport.sp b/addons/sourcemod/scripting/MyJailbreak/teleport.sp index 3f039c7c..0129efb0 100644 --- a/addons/sourcemod/scripting/MyJailbreak/teleport.sp +++ b/addons/sourcemod/scripting/MyJailbreak/teleport.sp @@ -373,7 +373,7 @@ public Action Command_Setteleport(int client, int args) LogToFileEx(g_sEventsLogFile, "Event teleport was started by groupvoting"); } } - else if (MyJailbreak_CheckVIPFlags(client, "sm_teleport_flag", gc_sAdminFlag, "sm_teleport_flag")) // Called by admin/VIP + else if (MyJB_CheckVIPFlags(client, "sm_teleport_flag", gc_sAdminFlag, "sm_teleport_flag")) // Called by admin/VIP { if (!gc_bSetA.BoolValue) { @@ -1129,4 +1129,20 @@ public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &dam TeleportEntity(victim, attackerPos, victimAimDir, NULL_VECTOR); return Plugin_Continue; +} + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); } \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/torch.sp b/addons/sourcemod/scripting/MyJailbreak/torch.sp index 9077d523..aaeb16a5 100644 --- a/addons/sourcemod/scripting/MyJailbreak/torch.sp +++ b/addons/sourcemod/scripting/MyJailbreak/torch.sp @@ -468,7 +468,7 @@ public Action Command_SetTorch(int client, int args) LogToFileEx(g_sEventsLogFile, "Event Torch Relay was started by groupvoting"); } } - else if (MyJailbreak_CheckVIPFlags(client, "sm_torch_flag", gc_sAdminFlag, "sm_torch_flag")) // Called by admin/VIP + else if (MyJB_CheckVIPFlags(client, "sm_torch_flag", gc_sAdminFlag, "sm_torch_flag")) // Called by admin/VIP { if (!gc_bSetA.BoolValue) { @@ -1512,4 +1512,20 @@ public void Event_PlayerSpawn(Event event, const char[] name, bool dontBroadcast ResetSprint(client); g_iSprintStatus[client] &= ~ IsSprintCoolDown; +} + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); } \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/war.sp b/addons/sourcemod/scripting/MyJailbreak/war.sp index ba55cd4c..7663ac8b 100644 --- a/addons/sourcemod/scripting/MyJailbreak/war.sp +++ b/addons/sourcemod/scripting/MyJailbreak/war.sp @@ -375,7 +375,7 @@ public Action Command_SetWar(int client, int args) LogToFileEx(g_sEventsLogFile, "Event War was started by groupvoting"); } } - else if (MyJailbreak_CheckVIPFlags(client, "sm_war_flag", gc_sAdminFlag, "sm_war_flag")) // Called by admin/VIP + else if (MyJB_CheckVIPFlags(client, "sm_war_flag", gc_sAdminFlag, "sm_war_flag")) // Called by admin/VIP { if (!gc_bSetA.BoolValue) { @@ -1178,4 +1178,20 @@ public Action Timer_BeaconOn(Handle timer) } g_hTimerBeacon = null; +} + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); } \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/warden.sp b/addons/sourcemod/scripting/MyJailbreak/warden.sp index 0d4ba6ce..564ec677 100644 --- a/addons/sourcemod/scripting/MyJailbreak/warden.sp +++ b/addons/sourcemod/scripting/MyJailbreak/warden.sp @@ -1950,3 +1950,19 @@ void OnWardenCreation(int client) HandCuffs_OnWardenCreation(client); Glow_OnWardenCreation(client); } + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailBreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); +} \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/zeus.sp b/addons/sourcemod/scripting/MyJailbreak/zeus.sp index 0fbc4f17..17f2e2e2 100644 --- a/addons/sourcemod/scripting/MyJailbreak/zeus.sp +++ b/addons/sourcemod/scripting/MyJailbreak/zeus.sp @@ -398,7 +398,7 @@ public Action Command_SetZeus(int client, int args) LogToFileEx(g_sEventsLogFile, "Event Zeus was started by groupvoting"); } } - else if (MyJailbreak_CheckVIPFlags(client, "sm_zeus_flag", gc_sAdminFlag, "sm_zeus_flag")) // Called by admin/VIP + else if (MyJB_CheckVIPFlags(client, "sm_zeus_flag", gc_sAdminFlag, "sm_zeus_flag")) // Called by admin/VIP { if (!gc_bSetA.BoolValue) { @@ -1173,3 +1173,19 @@ public Action Timer_GiveZeus(Handle timer, int userid) GivePlayerItem(client, "weapon_taser"); } } + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); +} \ No newline at end of file diff --git a/addons/sourcemod/scripting/MyJailbreak/zombie.sp b/addons/sourcemod/scripting/MyJailbreak/zombie.sp index 4557df57..2971fff7 100644 --- a/addons/sourcemod/scripting/MyJailbreak/zombie.sp +++ b/addons/sourcemod/scripting/MyJailbreak/zombie.sp @@ -468,7 +468,7 @@ public Action Command_SetZombie(int client, int args) LogToFileEx(g_sEventsLogFile, "Event Zombie was started by groupvoting"); } } - else if (MyJailbreak_CheckVIPFlags(client, "sm_zombie_flag", gc_sAdminFlag, "sm_zombie_flag")) // Called by admin/VIP + else if (MyJB_CheckVIPFlags(client, "sm_zombie_flag", gc_sAdminFlag, "sm_zombie_flag")) // Called by admin/VIP { if (!gc_bSetA.BoolValue) { @@ -1568,4 +1568,20 @@ public Action Timer_ReGenHealth(Handle timer) SetEntityHealth(i, GetClientHealth(i)+gc_iRegen.IntValue); } } +} + +bool MyJB_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature) +{ + if (gp_bMyJailbreak) + return MyJailbreak_CheckVIPFlags(client, command, flags, feature); + + char sBuffer[32]; + flags.GetString(sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) == 0) // ??? + return true; + + int iFlags = ReadFlagString(sBuffer); + + return CheckCommandAccess(client, command, iFlags); } \ No newline at end of file