Quote:
Originally Posted by swiftswing1
hi again. when i buy a melee weapon while on secondary slot, all is well. however, when i buy a melee weapon in any other slot (e.g. primary, grenade, medkit), it gives me the "failed to buy" error but i still get melee weapon. also no points are deducted from wallet. anyone else have this issue? thanks.
EDIT: i have found the problem. the shop seems to conflict with this plugin. if you turn off auto-switch on secondary pickup and buy a melee weapon, it will throw you the refund message but still give you the weapon. any possible way to fix this?
|
It is because some map may not have the melee, so there is a checking for buying melee.
PHP Code:
else if(StrEqual(weaponName, "weapon_melee"))
{
if (StrContains(weaponName, melee, false) == -1)
{
char playerWeaponName[32];
GetEntPropString(GetPlayerWeaponSlot(client, 1), Prop_Data, "m_strMapSetScriptName", playerWeaponName, sizeof(playerWeaponName));
if(StrEqual(playerWeaponName, melee))
{
isSucceed = true;
}
}
}
if you don't need the checking, just add
PHP Code:
bool BuyMelee(int client, const char[] melee, int price)
{
if(!g_bPointsOn) return false;
if(IsSurvivorDeadEx(client, melee)) return false;
bool isSucceed = false;
if (Checkout(client, melee, price, false))
{
isSucceed = true; //add
CheatCommand(client, "give", melee);
__________________