you'd need to make a death event that stores all player's headshot kills in a global variable. like so.
Code:
#define HEADSHOT_RATIO 0.50
new g_iHeadshots[33];
// Death event
public Ev_Death() {
new kId = read_data( 1 ); // Killer Index
new iHeadshot = read_data( 3 );
if ( iHeadshot )
g_iHeadshots[kId] += 1;
// Display message if headshots > HEADSHOT_RATIO
new iKills = get_user_frags( kId );
new Float:fRatio = float( g_iHeadshots[kId] ) / float( iKills );
if ( fRatio >= HEADSHOT_RATIO )
{
new szMessage[64];
format( szMessage, 63, "%0.0f%s of your kills are headshots!", fRatio * 100.0, "%%" );
// display this message however you need.
}
return PLUGIN_CONTINUE;
}
public plugin_init() {
// .. do other initializing in here
register_event( "DeathMsg", "Ev_Death", "a" );
return PLUGIN_CONTINUE;
}
I'm pretty sure you can display a % sign by stringing "%%", but i'm not 100% sure.
Hope this helps.
__________________