TF2_CalcIsAttackCritical is just for setting the critical shot or not
it does not show if the current shot is critical or not - ried with debug messages:
PHP Code:
public Action:TF2_CalcIsAttackCritical(client, weapon, String:weaponname[], &bool:result)
{
if(b_critenabled && crits_enabled[client])
{ //is plugin enabled?
#if defined DEBUG
new String:name[MAX_NAME_LENGTH]
GetClientName(client, name, sizeof(name))
#endif
new Float:r=GetRandomFloat(0.0, 1.0);
if ( r < crits_percent[client]) // if the generated random number is less than percent then set the crit, so 1.0 means always make crit, 0.0 means never crit
{
#if defined DEBUG
PrintToChat(client, "RAW %s : r=%f cp=%f => %d", name, r,crits_percent[client],FloatCompare(r,crits_percent[client]))
#endif
result = true;
}
else {
#if defined DEBUG
PrintToChat(client, "RAW %s : r=%f cp=%f => %d", name, r,crits_percent[client],FloatCompare(r,crits_percent[client]))
#endif
result = false;
}
if(result)
{
crits_count[client]++
}
else
{
nocrits_count[client]++
}
#if defined DEBUG2
PrintToChat(client, "+CRIT/NOCRITS: %d / %d", crits_count[client],nocrits_count[client] )
#endif
return Plugin_Handled;
}
if(result)
{
crits_count[client]++
}
else
{
nocrits_count[client]++
}
#if defined DEBUG2
PrintToChat(client, "-CRIT/NOCRITS: %d / %d / %b", crits_count[client],nocrits_count[client], result )
#endif
return Plugin_Continue;
}
__________________