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

[REQ]Remove weapons from shop [CS:GO]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rxelik
Junior Member
Join Date: Nov 2018
Old 11-09-2018 , 19:04   [REQ]Remove weapons from shop [CS:GO]
Reply With Quote #1

How hard it is to remove/make weapons unavailable/unusable?
Thanks for the Help!
Rxelik is offline
HvG Community
AlliedModders Donor
Join Date: Sep 2012
Old 11-09-2018 , 19:11   Re: [REQ]Remove weapons from shop [CS:GO]
Reply With Quote #2

Quote:
mp_buytime 0
or

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

Source: https://forums.alliedmods.net/showthread.php?t=275858
HvG Community is offline
Rxelik
Junior Member
Join Date: Nov 2018
Old 11-09-2018 , 19:42   Re: [REQ]Remove weapons from shop [CS:GO]
Reply With Quote #3

Quote:
Originally Posted by HvG Community View Post
or

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

Source: https://forums.alliedmods.net/showthread.php?t=275858
i need specific weapons
Rxelik is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 11-09-2018 , 20:39   Re: [REQ]Remove weapons from shop [CS:GO]
Reply With Quote #4

Quote:
Originally Posted by Rxelik View Post
i need specific weapons
Code:
public Action:CS_OnGetWeaponPrice(int client, const char[] weapon, int& price)
{
	if(StrEqual(weapon, "weapon_g3sg1") || StrEqual(weapon, "weapon_scar20")) // The auto noobs.	
	{
		price = 2147483647; // The biggest number the game can support.
		return Plugin_Changed;
	}
	
	return Plugin_Continue;
}

Or:

mp_items_prohibited 1,2,3,4,5,6,7,8,9...

If you reach infinity, you'll have blocked all weapons, so you have to iterate all numbers to figure out what's what. There's also a GetEntProp for that to debug but whatever you can just iterate through all numbers ( there are less than 50 total weapons. )
__________________


Accepting private work. Contact me if you're interested.

Last edited by eyal282; 11-09-2018 at 20:45.
eyal282 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 14:20.


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