Raised This Month: $51 Target: $400
 12% 

Awp Restriction Player Limit


Post New Thread Reply   
 
Thread Tools Display Modes
aSmig
Junior Member
Join Date: Nov 2008
Old 11-11-2008 , 02:20   Re: Awp Restriction Player Limit
Reply With Quote #11

Thanks for the Plugin. How about adding another cvar for the number of awps to allow after the user threshold is reached? So instead of completely unrestricting, restrict to 1 per team or similar.
aSmig is offline
tootall
New Member
Join Date: Nov 2008
Old 11-29-2008 , 04:10   Re: Awp Restriction Player Limit
Reply With Quote #12

Some noob questions. How do I use this with mani? Is there a way to change the player limit and can I restrict other weapons?
tootall is offline
Lebson506th
Veteran Member
Join Date: Jul 2008
Old 11-29-2008 , 07:45   Re: Awp Restriction Player Limit
Reply With Quote #13

This requires SourceMod as well. If you have sourcmod, it should just work on its own.

Use this one if you want more options:

https://forums.alliedmods.net/showth...light=restrict
__________________
My Plugins
Spray Tracer by Nican, maintained by me
Simple TK Manager
DoD:S Admin Weapons

Links
Resistance and Liberation (A HL2 Multiplayer Modification)
Lebson506th is offline
tootall
New Member
Join Date: Nov 2008
Old 11-30-2008 , 00:31   Re: Awp Restriction Player Limit
Reply With Quote #14

Thanks for your help. I don't need to restrict weapons all the time I can do that already. What I am looking for is something like this plugin that only restricts certain weapons after x amount of players have joined. Basically Awps kill my server before it gets going so I would like to restrict them until 12 players join. It would be nice for it to be configurable so I could do it with any weapon and any set number of players.Anyway if anyone can help or maybe make a plugin that will do this it would be greatly appreciated.
tootall is offline
aSmig
Junior Member
Join Date: Nov 2008
Old 12-19-2008 , 19:50   Re: Awp Restriction Player Limit
Reply With Quote #15

I ended up tweaking this plugin a bit to suit my needs. Same idea with a couple more options and associated cvars. Sorry, no multi-weapon support though, tootall. Details:

http://ta.failte.romhat.net/blog/?p=7
Attached Files
File Type: sp Get Plugin or Get Source (awplimits5.sp - 759 views - 2.9 KB)

Last edited by aSmig; 12-19-2008 at 20:01. Reason: attached source
aSmig is offline
svito
Junior Member
Join Date: Jan 2009
Location: Slovakia
Old 01-20-2009 , 17:42   Re: Awp Restriction Player Limit
Reply With Quote #16

Quote:
Originally Posted by aSmig View Post
I ended up tweaking this plugin a bit to suit my needs. Same idea with a couple more options and associated cvars. Sorry, no multi-weapon support though, tootall. Details:

http://ta.failte.romhat.net/blog/?p=7
How to order not blocks in AWP mapas?
svito is offline
KillerSneak
Member
Join Date: Feb 2008
Old 02-03-2009 , 06:07   Re: Awp Restriction Player Limit
Reply With Quote #17

So to get this right does this plugin work on it's own now or not?

Do i need
https://forums.alliedmods.net/showth...light=restrict
to run it, or can it run without it?
__________________
www.DoNotArgue.com
- no arguements needed
KillerSneak is offline
Archangel_Dm
Junior Member
Join Date: Mar 2009
Old 04-01-2009 , 09:45   Re: Awp Restriction Player Limit
Reply With Quote #18

Author please.
1. Does this thing, if there are 8-12 players on server - allowed 1 AWP; if 13-16 players - allowed 2 AWP; if 17-21 pl. - 3 AWP and etc.

2. This plugin only work on de_ cs_ as_ maps.
Thks
Archangel_Dm is offline
Vader_666
Member
Join Date: Feb 2008
Old 05-07-2009 , 13:11   Re: Awp Restriction Player Limit
Reply With Quote #19

I have a little problem with your plugin : it seems that after every changemap, it doesnt work. I reload it, it works, the map change... Restrict gone...

Any Idea ?
Vader_666 is offline
8Kuula
New Member
Join Date: May 2009
Old 05-17-2009 , 19:05   Re: Awp Restriction Player Limit
Reply With Quote #20

Did use this plugin as template and made sniper_restriction_limits plugin
here is code if author want update or someone else. Feel free

Code:
#include <sourcemod>
#include <sdktools>
#include <events>
#pragma semicolon 1
#define TEAM_T 2
#define TEAM_CT 3

new Handle:g_Cvar_MinClientsScout = INVALID_HANDLE;
new Handle:g_Cvar_MinScouts = INVALID_HANDLE;
new Handle:g_Cvar_MaxScouts = INVALID_HANDLE;
new bool:g_IsScoutLimit = false;

new Handle:g_Cvar_MinClientsSg550 = INVALID_HANDLE;
new Handle:g_Cvar_MinSg550s = INVALID_HANDLE;
new Handle:g_Cvar_MaxSg550s = INVALID_HANDLE;
new bool:g_IsSg550Limit = false;

new Handle:g_Cvar_MinClientsG3sg1 = INVALID_HANDLE;
new Handle:g_Cvar_MinG3sg1s = INVALID_HANDLE;
new Handle:g_Cvar_MaxG3sg1s = INVALID_HANDLE;
new bool:g_IsG3sg1Limit = false;

new Handle:g_Cvar_MinClientsAWP = INVALID_HANDLE;
new Handle:g_Cvar_MinAWPs = INVALID_HANDLE;
new Handle:g_Cvar_MaxAWPs = INVALID_HANDLE;
new bool:g_IsAWPLimit = false;

new bool:g_hasmani = false;
new bool:g_hasrestrict = false;

public Plugin:myinfo = {
    name = "Sniper Restriction Limits",
    author = "8Kuula",
    description = "Restricts sniper rifles based on number of players in game.",
    version = "1.0",
}

public OnPluginStart() {
    new Handle:hnMani = INVALID_HANDLE;
    if ((hnMani = FindConVar("mani_admin_plugin_version")) != INVALID_HANDLE) {
    CloseHandle(hnMani);
    g_hasmani = true;
    }
    
    if (FindPluginByFile("restrict.smx") != INVALID_HANDLE) {
    g_hasrestrict = true;
    }
    
    g_Cvar_MinClientsScout = CreateConVar("sm_srl_min_clients_scout", "4", "Min players required to unrestrict the scout.");
    g_Cvar_MinScouts = CreateConVar("sm_srl_min_scout", "0", "Number of scouts allowed per team before threshold is reached.");
    g_Cvar_MaxScouts = CreateConVar("sm_srl_max_scout", "1", "Number of scouts allowed per team after threshold is reached.");
    
    g_Cvar_MinClientsSg550 = CreateConVar("sm_srl_min_clients_sg550", "6", "Min players required to unrestrict the sg550.");
    g_Cvar_MinSg550s = CreateConVar("sm_srl_min_sg550", "0", "Number of sg550s allowed per team before threshold is reached.");
    g_Cvar_MaxSg550s = CreateConVar("sm_srl_max_sg550", "1", "Number of sg550s allowed per team after threshold is reached.");
    
    g_Cvar_MinClientsG3sg1 = CreateConVar("sm_srl_min_clients_g3sg1", "8", "Min players required to unrestrict the g3sg1.");
    g_Cvar_MinG3sg1s = CreateConVar("sm_srl_min_g3sg1", "0", "Number of g3sg1s allowed per team before threshold is reached.");
    g_Cvar_MaxG3sg1s = CreateConVar("sm_srl_max_g3sg1", "1", "Number of g3sg1s allowed per team after threshold is reached.");
    
    g_Cvar_MinClientsAWP = CreateConVar("sm_srl_min_clients_awp", "10", "Min players required to unrestrict the AWP.");
    g_Cvar_MinAWPs = CreateConVar("sm_srl_min_awp", "0", "Number of AWPs allowed per team before threshold is reached.");
    g_Cvar_MaxAWPs = CreateConVar("sm_srl_max_awp", "1", "Number of AWPs allowed per team after threshold is reached.");

    if (!HookEvent("round_start", Event_LimitCheck, EventHookMode_PostNoCopy)) {
    SetFailState("Could not hook the round_start event.");
    }

}

public Action:Event_LimitCheck(Handle:event, const String:name[], bool:dontBroadcast) {
    LimitCheck();
}

public OnMapStart() {
    g_IsScoutLimit = false;
    g_IsSg550Limit = false;
    g_IsG3sg1Limit = false;
    g_IsAWPLimit = false;
}

LimitCheck() {
    if (((GetConVarInt(g_Cvar_MinClientsScout) > 0) && ((GetTeamClientCount(TEAM_T) + GetTeamClientCount(TEAM_CT)) < GetConVarInt(g_Cvar_MinClientsScout)))) {LimitScoutMin();}
    else {LimitScoutMax();}

    if (((GetConVarInt(g_Cvar_MinClientsSg550) > 0) && ((GetTeamClientCount(TEAM_T) + GetTeamClientCount(TEAM_CT)) < GetConVarInt(g_Cvar_MinClientsSg550)))) {LimitSg550Min();}
    else {LimitSg550Max();}

    if (((GetConVarInt(g_Cvar_MinClientsG3sg1) > 0) && ((GetTeamClientCount(TEAM_T) + GetTeamClientCount(TEAM_CT)) < GetConVarInt(g_Cvar_MinClientsG3sg1)))) {LimitG3sg1Min();}
    else {LimitG3sg1Max();}

    if (((GetConVarInt(g_Cvar_MinClientsAWP) > 0) && ((GetTeamClientCount(TEAM_T) + GetTeamClientCount(TEAM_CT)) < GetConVarInt(g_Cvar_MinClientsAWP)))) {LimitAWPMin();}
    else {LimitAWPMax();}
}

LimitScoutMin() {
    if (!g_IsScoutLimit) {
    g_IsScoutLimit = true;
    
    if(g_hasmani) {
        ServerCommand("ma_restrict scout %i", GetConVarInt(g_Cvar_MinScouts));
    } else {
        if (g_hasrestrict) ServerCommand("sm_restrict scout %i", GetConVarInt(g_Cvar_MinScouts));
    }
    }
}

LimitScoutMax() {
    if (g_IsScoutLimit) {
    g_IsScoutLimit = false;
    
    if(g_hasmani) {
        ServerCommand("ma_restrict scout %i", GetConVarInt(g_Cvar_MaxScouts));
    } else {
        if (g_hasrestrict) ServerCommand("sm_restrict scout %i", GetConVarInt(g_Cvar_MaxScouts));
    }
    }
}

LimitSg550Min() {
    if (!g_IsSg550Limit) {
    g_IsSg550Limit = true;
    
    if(g_hasmani) {
        ServerCommand("ma_restrict sg550 %i", GetConVarInt(g_Cvar_MinSg550s));
    } else {
        if (g_hasrestrict) ServerCommand("sm_restrict sg550 %i", GetConVarInt(g_Cvar_MinSg550s));
    }
    }
}

LimitSg550Max() {
    if (g_IsSg550Limit) {
    g_IsSg550Limit = false;
    
    if(g_hasmani) {
        ServerCommand("ma_restrict sg550 %i", GetConVarInt(g_Cvar_MaxSg550s));
    } else {
        if (g_hasrestrict) ServerCommand("sm_restrict sg550 %i", GetConVarInt(g_Cvar_MaxSg550s));
    }
    }
}


LimitG3sg1Min() {
    if (!g_IsG3sg1Limit) {
    g_IsG3sg1Limit = true;
    
    if(g_hasmani) {
        ServerCommand("ma_restrict g3sg1 %i", GetConVarInt(g_Cvar_MinG3sg1s));
    } else {
        if (g_hasrestrict) ServerCommand("sm_restrict g3sg1 %i", GetConVarInt(g_Cvar_MinG3sg1s));
    }
    }
}

LimitG3sg1Max() {
    if (g_IsG3sg1Limit) {
    g_IsG3sg1Limit = false;
    
    if(g_hasmani) {
        ServerCommand("ma_restrict g3sg1 %i", GetConVarInt(g_Cvar_MaxG3sg1s));
    } else {
        if (g_hasrestrict) ServerCommand("sm_restrict g3sg1 %i", GetConVarInt(g_Cvar_MaxG3sg1s));
    }
    }
}

LimitAWPMin() {
    if (!g_IsAWPLimit) {
    g_IsAWPLimit = true;
    
    if(g_hasmani) {
        ServerCommand("ma_restrict awp %i", GetConVarInt(g_Cvar_MinAWPs));
    } else {
        if (g_hasrestrict) ServerCommand("sm_restrict awp %i", GetConVarInt(g_Cvar_MinAWPs));
    }
    }
}

LimitAWPMax() {
    if (g_IsAWPLimit) {
    g_IsAWPLimit = false;
    
    if(g_hasmani) {
        ServerCommand("ma_restrict awp %i", GetConVarInt(g_Cvar_MaxAWPs));
    } else {
        if (g_hasrestrict) ServerCommand("sm_restrict awp %i", GetConVarInt(g_Cvar_MaxAWPs));
    }
    }
}
I hope all works, did wank with bots to try scenarios, and seemed to work ok with mani-admin-plugin restrictions. But never know...

Cvars:
Code:
// Sniper Restriction Limits.                                                                                                    
// Requires: sniper_restriction_limits.smx                                                                                       
sm_srl_max_awp 1                // Number of AWPs allowed per team after threshold is reached.                                   
sm_srl_max_g3sg1 1              // Number of g3sg1s allowed per team after threshold is reached.                                 
sm_srl_max_scout 1              // Number of scouts allowed per team after threshold is reached.                                 
sm_srl_max_sg550 1              // Number of sg550s allowed per team after threshold is reached.                                 

sm_srl_min_scout 0              // Number of scouts allowed per team before threshold is reached.                                
sm_srl_min_sg550 0              // Number of sg550s allowed per team before threshold is reached.                                
sm_srl_min_g3sg1 0              // Number of g3sg1s allowed per team before threshold is reached.                                
sm_srl_min_awp 0                // Number of AWPs allowed per team before threshold is reached.                                  

sm_srl_min_clients_scout 6      // Min players required to unrestrict the scout.                                                 
sm_srl_min_clients_sg550 8      // Min players required to unrestrict the sg550.                                                 
sm_srl_min_clients_g3sg1 8      // Min players required to unrestrict the g3sg1.                                                 
sm_srl_min_clients_awp 10        // Min players required to unrestrict the AWP.
8Kuula is offline
Reply



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 09:25.


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