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

block buy item


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TrullSin
Senior Member
Join Date: Jun 2018
Old 03-09-2019 , 20:24   block buy item
Reply With Quote #1

Hi, could anyone make me a plugin to block something from buymenu? It is for CS:GO
TrullSin is offline
paulo_crash
AlliedModders Donor
Join Date: May 2016
Location: Brazil
Old 03-09-2019 , 22:16   Re: block buy item
Reply With Quote #2

Quote:
Originally Posted by TrullSin View Post
Hi, could anyone make me a plugin to block something from buymenu? It is for CS:GO
https://forums.alliedmods.net/showthread.php?p=950174
paulo_crash is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 03-10-2019 , 05:15   Re: block buy item
Reply With Quote #3

i use this from Mitchell, from here and its working

PHP Code:
public void OnPluginStart() {
    
HookEvent("round_start"Event_RoundStart);
}

public 
Action Event_RoundStart(Event event, const char[] namebool dontBroadcast) {
    
GameRules_SetProp("m_bTCantBuy"true__true); // T Can't buy
    
GameRules_SetProp("m_bCTCantBuy"true__true); // CT can't buy


Last edited by iskenderkebab33; 03-10-2019 at 05:18.
iskenderkebab33 is offline
TrullSin
Senior Member
Join Date: Jun 2018
Old 03-10-2019 , 08:27   Re: block buy item
Reply With Quote #4

I want to block a weapon in the buymenu, if I use from Mitchell it will block all menu, and weapon restrict, I cant get dropped weapons, just want to block one gun, for example, deagle in the buymenu.

Last edited by TrullSin; 03-10-2019 at 08:27.
TrullSin is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 03-10-2019 , 08:48   Re: block buy item
Reply With Quote #5

Code:
public Action CS_OnBuyCommand(int client, const char[] weapon)
{
	if (StrEqual(weapon, "deagle", false))
	{
		PrintToChat(client, "You are not allowed to buy a Deagle.");
		return Plugin_Handled;
	}
	
	return Plugin_Continue;
}
Something like this, might have to change the name from 'deagle' to something like 'weapon_deagle' if it doesn't work properly.

Last edited by Drixevel; 03-10-2019 at 08:48.
Drixevel 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 19:35.


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