Raised This Month: $ Target: $400
 0% 

Headshot counter


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Ryan
Senior Member
Join Date: May 2004
Location: NH, USA
Old 07-15-2004 , 21:38  
Reply With Quote #2

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.
__________________
Warcraft 3: Expansion
Homepage | Downloads | Forums
Ryan is offline
Send a message via AIM to Ryan
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:40.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode