AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Unblocking buying defuser on other maps than de_ prefix (https://forums.alliedmods.net/showthread.php?t=276406)

JabLuszko 12-20-2015 18:22

Unblocking buying defuser on other maps than de_ prefix
 
Hello!

How can you unblock buying defuser on maps with other prefix than de_? Looks like it is somehow locked to map prefix, not to func_bomb_target/info_bomb_target. For being sure I checked GameRules and both m_bMapHasBombZone and m_bMapHasBombTarget are set to true.

Reproduce:
Rename de_dust2.bsp to xxx_dust2.bsp, start game on it and as CT you won't be able to buy a defuser.

Disc:
Yes, I know I can rename map to de_, but I would like stick to original name.
Yes, I know that there are plugins for "say /defuser", but this is not an answer for me.
Also giving everyone defuser on roundstart is not an option :P

HamletEagle 12-21-2015 09:41

Re: Unblocking buying defuser on other maps than de_ prefix
 
I have tested and it's pretty strange.

In BuyItem you can see such check for defuser:
PHP Code:

case MENU_SLOT_ITEM_DEFUSEKIT:
{
    if (
pPlayer->m_iTeam != CT || !g_pGameRules->m_bMapHasBombTarget)
    {
        return;
    } 

It seems that the item is locked from another place on map prefix. For example, if you rename a cs_ map to de_ defuser is available in the menu but nothing happens if you buy it(unless you spawn a func_bomb_target entity to make m_bMapHasBombTarget offset true).

Unfortunately I was not able to understand from where the item is locked on map prefix.

Arkshine 12-21-2015 11:03

Re: Unblocking buying defuser on other maps than de_ prefix
 
This is a client-side thing because you are testing with VGUI menu, it checks against current level name. It doesn't happen with old menu where item is well buyable depending bomb entities.

JabLuszko 12-21-2015 14:27

Re: Unblocking buying defuser on other maps than de_ prefix
 
Just checked with old menu and it works there. Why Valve can't use the same code in both menus?:<
Looks like map name change is the only way.

Thanks Arkshine and HamletEagle!


All times are GMT -4. The time now is 18:06.

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