02.01.2018, 18:12
Change in switch, case statement which weapon you want to forbid.
By the way, I don't know why do you use ForbiddenWeaponsDrop?
PHP код:
public ForbidWeaponDrop(weaponid) // return 1 if the weapon is forbidden, return 0 is the weapon isn't
{
if(!(0 <= weaponid <= 46) && (19 <= weaponid <= 21)) // if the weapon is valid - < 46 or between 19 & 21
{
ForbiddenWeaponsDrop[weaponid] = true;
return 1;
}
else
{
switch(weaponid) // we check, case by case
{
case 22, 24: ForbiddenWeaponsDrop[weaponid] = true;
default : return 0;
}
}
return 1;
}
public FreeWeaponDrop(weaponid) // if a weapon is forbidden, it can not be authorized
{
if(ForbidWeaponDrop(weaponid))
return ForbiddenWeaponsDrop[weaponid] = false, 0;
else
return ForbiddenWeaponsDrop[weaponid] = false, 1;
}