AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Need Awp Cvar Per Team Limit (https://forums.alliedmods.net/showthread.php?t=339047)

Begineer Programmer 08-12-2022 02:09

Need Awp Cvar Per Team Limit
 
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 !!!

deprale 08-24-2022 11:03

Re: Need Awp Cvar Per Team Limit
 
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.

bibu 08-24-2022 11:15

Re: Need Awp Cvar Per Team Limit
 
Or: https://forums.alliedmods.net/showthread.php?p=444328

counterstrike1.6 08-30-2022 14:44

Re: Need Awp Cvar Per Team Limit
 
1 Attachment(s)
Quote:

Originally Posted by deprale (Post 2787302)
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]


All times are GMT -4. The time now is 00:20.

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