The weapon_teaser should be in the knife slot and the weapon_healthshot should be in the C4 slot.
Try printing the debug message like this to see if it detects those weapons(healthshot & teaser) before the StrEqual.
PHP Code:
stock bool WeaponsClientHasWeapon(int client, const char weapon[32])
{
// Get all of client's current weapons.
int weapons[WeaponsSlot];
WeaponsGetClientWeapons(client, weapons);
char classname[64];
// x = slot index
for (int x = 0; x < WEAPONS_SLOTS_MAX; x++)
{
// If slot is empty, then stop.
if (weapons[x] == -1)
{
continue;
}
// If the weapon's classname matches, then return true.
GetEdictClassname(weapons[x], classname, sizeof(classname));
//ReplaceString(classname, sizeof(classname), "weapon_", "");
PrintToChat(client,"[DEBUG] User weapon %s | Weapon to check for : %s",classname,weapon);
if (StrEqual(weapon, classname, false))
{
return true;
}
}
return false;
}
Also it doesn't matter the order you have the functions declared.
For more tests try adding a cmd function !test to call the checking weapons function and see if then it detects if you have healthshot or teaser.