Raised This Month: $ Target: $400
 0% 

[CS:GO] I created this plugin to block weapon buy


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 02-01-2023 , 06:39   Re: [CS:GO] I created this plugin to block weapon buy
Reply With Quote #5

I would do something like this:
PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <cstrike>
#include <sdktools_gamerules>

static const char WPN[][] = {"ump45""p90""mp9""mp7""mp5sd""mac10""bizon""ssg08""sg556""scar20""m4a1_silencer""m4a1""galilar""g3sg1""famas""awp""aug""ak47""xm1014""sawedoff""nova""negev""mag7""m249"};

bool bBlock;

public 
void OnPluginStart()
{
    
HookEvent("round_start"Event_StartEventHookMode_PostNoCopy);
    
CheckRoundNum();
}

public 
void Event_Start(Event event, const char[] namebool dontBroadcast)
{
    
CheckRoundNum();
}

stock void CheckRoundNum()
{
    
int round GameRules_GetProp("m_totalRoundsPlayed");
    
bBlock round == || round == 15;
    
PrintToChatAll("%s allowed"bBlock "Only pistols" "All guns are");
}

public 
Action CS_OnBuyCommand(int client, const char[] weapon)
{
    if(!
bBlock)
        return 
Plugin_Continue;

    for(
int isizeof(WPN); i++) if(!strcmp(weaponWPN[i]))
    {
        
PrintToChat(client"'You're rich BUT I FORBID YOU TO BUY' - shadowbringer.");
        return 
Plugin_Handled;
    }

    return 
Plugin_Continue;

__________________
Grey83 is offline
 


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 03:23.


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