shanapu / MyWeaponAllocator

CSGO - Retakes weapon allocator
https://forums.alliedmods.net/showthread.php?t=309217
GNU General Public License v3.0
31 stars 13 forks source link

Not giving any pistols on Force Buy Round with SSG #13

Open borzaka opened 5 years ago

borzaka commented 5 years ago

If you select Desert Eagle as T force buy round weapon, and enable SSG, you won't get any pistol in Force Buy Round if you are given SSG:

image

So: If you selected Desert as force buy weapon, and also enabled SSG/AWP and SSG is given to you in forcebuy, you should have a default pistol in booth teams.

Probably related? #8

shanapu commented 5 years ago

Thanks for great report! I going to setup a test server and try to repoduce and fix it asap.

borzaka commented 5 years ago

Thank you very much in advance!

Some quick tips for testing:

Or just mywa_rounds_chance "3" :)

Type kill to the console, if you are not given an SSG to start over a round.

LemonPAKA commented 5 years ago

Change:

if (iRandom == 1 && g_bSniper[client] && gc_iScout_MinCT.IntValue <= GetPlayerCount(true, CS_TEAM_CT)) { if (g_iScout_CT < gc_iScout_CT.IntValue) { GivePlayerItem(client, "weapon_ssg08"); iMoney -= GetWeaponPrice("weapon_ssg08"); g_iScout_CT++; } else { GivePlayerItem(client, g_sSMG_CT[client]); iMoney -= GetWeaponPrice(g_sSMG_CT[client]); } }

To:

if (iRandom == 1 && g_bSniper[client] && gc_iScout_MinCT.IntValue <= GetPlayerCount(true, CS_TEAM_CT)) { if (g_iScout_CT < gc_iScout_CT.IntValue) { GivePlayerItem(client, "weapon_ssg08"); iMoney -= GetWeaponPrice("weapon_ssg08"); g_iScout_CT++; if (StrEqual(g_sSecondary_CT[client], "weapon_hkp2000")&&StrEqual(g_sSMG_CT[client], "weapon_deagle")) { GivePlayerItem(client, "weapon_hkp2000"); } else if (StrEqual(g_sSMG_CT[client], "weapon_deagle")) { GivePlayerItem(client, "weapon_usp_silencer"); } } else { GivePlayerItem(client, g_sSMG_CT[client]); iMoney -= GetWeaponPrice(g_sSMG_CT[client]); } } T side as well I think it will be fixed by this.or more bugs lol

borzaka commented 5 years ago

@LemonPAKA I think that could work on the first looks.

My solution is pretty dumb, but it works, tested. The main goal is to check that the player got SSG, or not. I'am pretty sure that there is a more sophisticated way, but I can work only from the source.

On the T side change the if around GivePlayerItem(client, "weapon_glock");

if (!StrEqual(g_sSMG_T[client], "weapon_deagle") || ((iRandom == 1 && g_bSniper[client] && gc_iScout_MinT.IntValue <= GetPlayerCount(true, CS_TEAM_T)) && (g_iScout_T-1) < gc_iScout_T.IntValue))
{
        GivePlayerItem(client, "weapon_glock");
}
flowerpetals commented 4 years ago

Is this an official fix for this? I my community really could use one 👍

borzaka commented 4 years ago

Any official update for this? I think this is still the best retake weapon allocator plugin, don't abandon it please!

ninkaninus commented 4 years ago

is there a fix comming for this, as i also would like it 👍

enghausen commented 4 years ago

@borzaka - I tested your suggestion and it seems to work for both CT and T. I will try to make a better solution when I got the time to look into it :-) I will compile a new version on my fork later today.