Raised This Month: $ Target: $400
 0% 

elimination mod


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 10-09-2010 , 22:59   Re: elimination mod
Reply With Quote #5

Give this a try:
Code:
#include <amxmodx> #include <hamsandwich> #include <cstrike> #define ADVERTISE_TIME  30.0 #define is_player(%1) (1<=%1<=g_maxplayers) new Killed[33][31] new KillIndex[33] // to keep count new g_maxplayers public plugin_init() {     register_plugin( "Elimination", "1.1", "Wrecked" )         RegisterHam( Ham_Killed, "player", "HamKilledPost", 1 )         set_task( ADVERTISE_TIME, "TaskAdvertise", .flags="b" )         g_maxplayers = get_maxplayers() } public HamKilledPost( victim, killer ) {     new i     new vname[32]     get_user_name( victim, vname, 31 )         while( Killed[victim][++i] )     {         if( !is_user_alive( i ) )         {             ExecuteHamB( Ham_CS_RoundRespawn, i )             ChatColor( i, "!g%s has died! You may now respawn.", vname )         }     }         arrayset( Killed[victim], 0, 31 )     KillIndex[victim] = 0         if( !is_player( killer ) || ( cs_get_user_team( killer ) == cs_get_user_team( victim ) ) )     {         set_task( 5.0, "TaskRespawn", victim )         ChatColor( victim, "!gYou will be respawned in 5 seconds." )                 return;     }         new kname[32]     get_user_name( killer, kname, 31 )         ChatColor( victim, "!gYou will be respawned when %s dies.", kname )         Killed[killer][KillIndex[killer]++] = victim } public TaskAdvertise() {     ChatColor( 0, "!gYou are playing elimination - you will respawn when your killer dies" ) } public TaskRespawn( id ) {     if( !is_user_alive( id ) )     {         ExecuteHamB( Ham_CS_RoundRespawn, id )     } } ChatColor( id, const input[], any:... ) {     new count = 1;     new players[32];     static msg[191];     vformat(msg, 190, input, 3);         replace_all(msg, 190, "!g", "^4"); // Green Color     replace_all(msg, 190, "!y", "^1"); // Default Color         if (id)     players[0] = id;     else     get_players(players, count, "ch");         for (new i = 0; i < count; i++)     {         if (is_user_connected(players[i]))         {             message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);             write_byte(players[i]);             write_string(msg);             message_end();         }     } }
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT

Last edited by wrecked_; 10-10-2010 at 03:22.
wrecked_ 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 10:21.


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