Raised This Month: $ Target: $400
 0% 

elimination mod


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hostingguy
Member
Join Date: Jan 2008
Old 10-09-2010 , 22:40   elimination mod
Reply With Quote #1

Hi,

I tried searching but dont really know which words to use so I dont think I did a very good search - but basically what I am looking for is a mod or chuck of code that does this:

all players spawn as usual, and when a player dies he stays dead until the person who killed him dies. When you die, all players you kill respawn and that keeps going until the other team is completley wiped out.

Its kind of a modified deathmatch - can some one either provide some code or maybe point me to an existing mod for amxx that can do this?

Thank you in advance!
hostingguy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-09-2010 , 22:44   Re: elimination mod
Reply With Quote #2

Are you asking for a working plugin or are you going to write this yourself?
__________________
fysiks is offline
hostingguy
Member
Join Date: Jan 2008
Old 10-09-2010 , 22:46   Re: elimination mod
Reply With Quote #3

Preferably something working but if an existing plugin can do this just point me that way

Thx
hostingguy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-09-2010 , 22:55   Re: elimination mod
Reply With Quote #4

Ok, FYI, Scripting Help is for those who are going to write the plugin. Best to put requests in the "Suggestions/Requets".

However, your request reminds me of playing dodgeball in High School.
__________________
fysiks is offline
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
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-09-2010 , 23:14   Re: elimination mod
Reply With Quote #6

I thought about doing it that way at first but there is a way to do it with just a single 33 sized array. Of course it involves using get_players(dead players) so I'm not sure which would be better.
__________________
fysiks is offline
hostingguy
Member
Join Date: Jan 2008
Old 10-10-2010 , 02:14   Re: elimination mod
Reply With Quote #7

Can you make the following mods?

- every 30 seconds say to all alive players
"You are playing elimination - you will respawn when your killer dies"

- when a player dies by suicide or anything other than the other team killing them they are respawned after 5 seconds

- when they die say to that player
"You will respawn when XXX dies" where XXX is the name of the player

Preferably with those say commands in non standard colors - like green or something so it stands out.
hostingguy is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 10-10-2010 , 02:31   Re: elimination mod
Reply With Quote #8

Code:
#include <amxmodx>
#include <hamsandwich>

new Killed[33][31]
new KillIndex[33] // to keep count

public plugin_init()
{
    register_plugin( "Elimination", "1.0", "Wrecked" )
    
    RegisterHam( Ham_Killed, "player", "HamKilledPost", 1 )
    
    set_task( 30.0, "advertise", _, _, _, "b" )
}

public HamKilledPost( victim, killer )
{
    new i
    new name[32], name2[32];
    get_user_name( victim, name, 31 )
    get_user_name( killer, name2, 31 )
    
    if( is_user_connected( killer ) )
    {
        client_print( victim, print_chat, "You will respawn when %s dies.", name2)
    }
    
    while( Killed[victim][++i] )
    {
        if( !is_user_alive( i ) )
        {
            ExecuteHamB( Ham_CS_RoundRespawn, i )
            client_print( i, print_chat, "%s has died! You may now respawn.", name2 )
        }
    }
    
    arrayset( Killed[victim], 0, 31 )
    KillIndex[victim] = 0
    
    Killed[killer][KillIndex[killer]++] = victim
}

public advertise()
{
    new players[32], num;
    get_players(players, num)
    for( new i;i<num;i++ )
    {
        if( is_user_alive(players[i]) )
        {
            client_print( players[i], print_chat, "You are playing elimination. You will respawn when your killer dies." )
        }
    }
}
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 10-10-2010 , 03:19   Re: elimination mod
Reply With Quote #9

Updated in previous post. Post #8 does not have the 5 second respawn nor the colored chat included.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT

Last edited by wrecked_; 10-10-2010 at 03:27.
wrecked_ is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 10-19-2010 , 14:00   Re: elimination mod
Reply With Quote #10

@wrecked:

I tested it with the newest podbots, it does only respawn me, if my victim (bot) gets killed, for the other bots, nothing..
bibu is offline
Reply



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