Raised This Month: $32 Target: $400
 8% 

Solved Need Awp Cvar Per Team Limit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Begineer Programmer
Member
Join Date: Nov 2021
Old 08-12-2022 , 02:09   Need Awp Cvar Per Team Limit
Reply With Quote #1

Hi All !!!
i need to add awp cvar per team if it limit reached user get message [your awp team limit reach] !!!
And if they want to buy by pressing b its should also show to user same message !!!

Last edited by Begineer Programmer; 08-31-2022 at 05:56.
Begineer Programmer is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 08-24-2022 , 11:03   Re: Need Awp Cvar Per Team Limit
Reply With Quote #2

Credits: OciXCrom
PHP Code:
#include <amxmodx>
#include <cstrike>

#if !defined CSI_AWP
    #error "This plugin requires AMXX 1.9 or a newer version."
#endif

const MAX_AWPS_PER_TEAM 3

new g_iAWPCount[CsTeams]

public 
plugin_init()
{
    
register_plugin("Max AWPs Per Team""1.0""OciXCrom")
    
register_logevent("OnRoundStart"2"0=World triggered""1=Round_Start")
}

public 
OnRoundStart()
{
    
g_iAWPCount[CS_TEAM_CT] = 0
    g_iAWPCount
[CS_TEAM_T] = 0
}

public 
CS_OnBuy(idiItem)
{
    if(
iItem == CSI_AWP)
    {
        new 
CsTeams:iTeam cs_get_user_team(id)

        if(
g_iAWPCount[iTeam] == MAX_AWPS_PER_TEAM)
        {
            
client_print(idprint_center"Your team cannot purchase more than %i AWPs per round."MAX_AWPS_PER_TEAM)
            return 
PLUGIN_HANDLED
        
}

        
g_iAWPCount[iTeam]++
    }

    return 
PLUGIN_CONTINUE

It's not a proper plugin, like... it won't count if the alive players already have an awp from the last round so the amount of awps will never really be the amount you set it to because if the 2 or 3 awpers survive all together then the next round another 2 or 3 awps can be bought, and there's no cvar for setting it like you want mid-game... let me know if you want it updated.
__________________

Last edited by deprale; 08-24-2022 at 11:10.
deprale is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 08-24-2022 , 11:15   Re: Need Awp Cvar Per Team Limit
Reply With Quote #3

Or: https://forums.alliedmods.net/showthread.php?p=444328
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
counterstrike1.6
Member
Join Date: Oct 2020
Old 08-30-2022 , 14:44   Re: Need Awp Cvar Per Team Limit
Reply With Quote #4

Quote:
Originally Posted by deprale View Post
Credits: OciXCrom
PHP Code:
#include <amxmodx>
#include <cstrike>

#if !defined CSI_AWP
    #error "This plugin requires AMXX 1.9 or a newer version."
#endif

const MAX_AWPS_PER_TEAM 3

new g_iAWPCount[CsTeams]

public 
plugin_init()
{
    
register_plugin("Max AWPs Per Team""1.0""OciXCrom")
    
register_logevent("OnRoundStart"2"0=World triggered""1=Round_Start")
}

public 
OnRoundStart()
{
    
g_iAWPCount[CS_TEAM_CT] = 0
    g_iAWPCount
[CS_TEAM_T] = 0
}

public 
CS_OnBuy(idiItem)
{
    if(
iItem == CSI_AWP)
    {
        new 
CsTeams:iTeam cs_get_user_team(id)

        if(
g_iAWPCount[iTeam] == MAX_AWPS_PER_TEAM)
        {
            
client_print(idprint_center"Your team cannot purchase more than %i AWPs per round."MAX_AWPS_PER_TEAM)
            return 
PLUGIN_HANDLED
        
}

        
g_iAWPCount[iTeam]++
    }

    return 
PLUGIN_CONTINUE

It's not a proper plugin, like... it won't count if the alive players already have an awp from the last round so the amount of awps will never really be the amount you set it to because if the 2 or 3 awpers survive all together then the next round another 2 or 3 awps can be bought, and there's no cvar for setting it like you want mid-game... let me know if you want it updated.
Hi i have plugin can you please add cvar for awp team limit and if user want to buy this from pressing b it should also give same msg [awp team limit reach !!!] and in menu i want to show message like that

3) Get AWP+Deagle [Max: %i]
Attached Files
File Type: sma Get Plugin or Get Source (gunmenu.sma - 48 views - 6.3 KB)

Last edited by counterstrike1.6; 08-30-2022 at 15:12.
counterstrike1.6 is offline
Reply


Thread Tools
Display Modes

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 07:37.


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