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

[REQ] Disable AWP for 2 rounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrazySkull2k
Member
Join Date: Feb 2017
Old 03-25-2021 , 15:04   [REQ] Disable AWP for 2 rounds
Reply With Quote #1

I'm trying to disable the awp and autosnipers for the first 2 rounds (and first 2 rounds after warmup). I have a VIP system that gives players with VIP money, and it's enough money for them to buy an awp
CrazySkull2k is offline
Cruze
Veteran Member
Join Date: May 2017
Old 03-26-2021 , 05:09   Re: [REQ] Disable AWP for 2 rounds
Reply With Quote #2

Untested.

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>

#pragma semicolon 1
#pragma newdecls required

int g_Round;

public 
void OnPluginStart()
{
    
HookEvent("round_start"OnRoundStart);
    
HookUserMessage(GetUserMessageId("TextMsg"), TextMsgHook);
}

public 
void OnMapStart()
{
    
g_Round 0;
}

public 
Action CS_OnBuyCommand(int client, const char[] weapon)
{
    if (
GameRules_GetProp("m_bWarmupPeriod") == || g_Round 3
    {
        return 
Plugin_Continue;
    }
    if(
StrContains(weapon"awp"false) != -|| StrContains(weapon"scar20"false) != -|| StrContains(weapon"g3sg1"false) != -1)
    {
        return 
Plugin_Handled;
    }
    return 
Plugin_Continue;
}

public 
void OnRoundStart(Event hEvent, const char[] sNamebool dontBroadcast)
{
    if(
GameRules_GetProp("m_bWarmupPeriod") == 0
    { 
        
g_Round++;
    }
}

public 
Action TextMsgHook(UserMsg umIdHandle hMsg, const int[] iPlayersint iPlayersNumbool bReliablebool bInit)
{
    
//Thank you SM9(); for this!!
    
char name[128], szValue[128]; 
    
PbReadString(hMsg"params"szValuesizeof(szValue), 1);
    
PbReadString(hMsg"params"namesizeof(name), 0);   
    if (
StrEqual(name"#SFUI_Notice_Game_will_restart_in"false)) 
    {
        
CreateTimer(StringToFloat(szValue), Timer_GameRestarted);
    }
    return 
Plugin_Continue;
}

public 
Action Timer_GameRestarted(Handle hTimer)
{
    
g_Round 1;

Attached Files
File Type: sp Get Plugin or Get Source (ahelpplugin.sp - 31 views - 1.4 KB)
__________________
Taking paid private requests! Contact me
Cruze 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 11:47.


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