AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [REQ]Remove weapons from shop [CS:GO] (https://forums.alliedmods.net/showthread.php?t=311955)

Rxelik 11-09-2018 18:04

[REQ]Remove weapons from shop [CS:GO]
 
How hard it is to remove/make weapons unavailable/unusable?
Thanks for the Help!

HvG Community 11-09-2018 18:11

Re: [REQ]Remove weapons from shop [CS:GO]
 
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

Rxelik 11-09-2018 18:42

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

Originally Posted by HvG Community (Post 2623322)
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

eyal282 11-09-2018 19:39

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

Originally Posted by Rxelik (Post 2623326)
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. )


All times are GMT -4. The time now is 21:50.

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