AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   elimination mod (https://forums.alliedmods.net/showthread.php?t=140235)

hostingguy 10-09-2010 22:40

elimination mod
 
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!

fysiks 10-09-2010 22:44

Re: elimination mod
 
Are you asking for a working plugin or are you going to write this yourself?

hostingguy 10-09-2010 22:46

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

Thx

fysiks 10-09-2010 22:55

Re: elimination mod
 
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.

wrecked_ 10-09-2010 22:59

Re: elimination mod
 
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();         }     } }

fysiks 10-09-2010 23:14

Re: elimination mod
 
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.

hostingguy 10-10-2010 02:14

Re: elimination mod
 
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.

nikhilgupta345 10-10-2010 02:31

Re: elimination mod
 
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." )
        }
    }
}


wrecked_ 10-10-2010 03:19

Re: elimination mod
 
Updated in previous post. Post #8 does not have the 5 second respawn nor the colored chat included.

bibu 10-19-2010 14:00

Re: elimination mod
 
@wrecked:

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


All times are GMT -4. The time now is 10:21.

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