Raised This Month: $ Target: $400
 0% 

REQ: Frags left annouce. (3frags left, 2 frags left.. Q3 style)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-08-2010 , 08:27   Re: REQ: Frags left annouce. (3frags left, 2 frags left.. Q3 style)
Reply With Quote #2

Try this.
Code:
#include < amxmodx > new g_pFragLimit; public plugin_init( ) {     register_plugin( "Frags Left Announcer", "1.0", "xPaw" );         register_event( "DeathMsg", "EventDeathMsg", "a", "2>0" );         g_pFragLimit = get_cvar_pointer( "mp_fraglimit" ); //  g_pFragLimit = register_cvar( "mp_fraglimit", "5" ); // The cvar doesn't exist in CS } public plugin_precache( ) {     precache_sound( "sound/misc/1frag.wav" );     precache_sound( "sound/misc/2frags.wav" );     precache_sound( "sound/misc/3frags.wav" ); } public EventDeathMsg( ) {     new iFragLimit = get_pcvar_num( g_pFragLimit ) - 3;         if( iFragLimit > 0 ) {         new iKiller = read_data( 1 ),             iFrags  = get_user_frags( iKiller ) + 1;                 if( iFrags >= iFragLimit ) {             iFrags = iFragLimit - iFrags + 3;                         if( !iFrags ) {                 new szName[ 32 ];                 get_user_name( iKiller, szName, 31 );                                 set_hudmessage( 128, 128, 128, -1.0, 0.15, 0, 10.0, 10.0, 0.2, 0.2, 2 );                 show_hudmessage( 0, "%s was first to reach frag limit !", szName );                                 client_print( 0, print_chat, "* %s was first to reach frag limit !", szName );                                 return;             }                         client_cmd( iKiller, "spk ^"misc/%ifrag%s^"", iFrags, iFrags == 1 ? "" : "s" );                         set_hudmessage( 128, 128, 128, -1.0, 0.15, 0, 3.0, 3.0, 0.2, 0.2, 2 );             show_hudmessage( iKiller, "%i Frag%s left !", iFrags, iFrags == 1 ? "" : "s" );         }     } }
__________________

Last edited by xPaw; 04-08-2010 at 13:35.
xPaw is offline
 



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 11:00.


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