AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   round time = 0:00 kill all player (https://forums.alliedmods.net/showthread.php?t=98294)

biscuit628 07-24-2009 07:33

round time = 0:00 kill all player
 
PHP Code:

#include <amxmodx>
 
new RoundTime;
 
public 
plugin_init()
{
        
register_plugin("Round Control""1.0""Biscuit");
 
        
register_logevent("RoundStart"2"1=Round_Start");
    
register_logevent("RoundStart"3"2=Planted_The_Bomb")
 
        
RoundTime get_cvar_pointer("mp_roundtime");
}
 
public 
RoundStart()
{
    if(
get_cvar_num("amx_respawn") != 1)
    {
            
remove_task(123);
        
set_task(get_pcvar_float(RoundTime), "KillPlayer"123);
    }
}
 
 
public 
KillPlayer()
{
    static 
g_iNum,g_iPlayers[32],msg[100]
    
get_players(g_iPlayersg_iNum"ach");
    for(new 
id id g_iNum id++)
    {
        
user_kill(id,1)
    }
    
format(msg,99,"^x04[Round Control]Round End,All player must be die")
    
client_color(0,1,msg)
}  

public 
client_color(playeridcoloridmsg[])
{
    
message_begin((playerid== 0) ? MSG_ALL MSG_ONE,get_user_msgid("SayText"),_,playerid
    
write_byte(colorid)
    
write_string(msg)
    
message_end()


my code is not work..

Xellath 07-24-2009 08:18

Re: round time = 0:00 kill all player
 
PHP Code:

#include <amxmodx>
 
#pragma semicolon 1
 
#define PLUGIN "Slay All"
#define VERSION "0.1"
#define AUTHOR "Xellath"
 
public plugin_init( ) 
{
    
register_pluginPLUGINVERSIONAUTHOR );
 
    
register_logevent"eventRoundEnd"2"1=Round_End" );
}
 
public 
eventRoundEnd( )
{
    new 
iPlayers32 ], iNum;
 
    
get_playersiPlayersiNum"ach" );
 
    for( new 
iNum i++ )
        
user_killiPlayers] );


Try that, not tested.

biscuit628 07-24-2009 08:35

Re: round time = 0:00 kill all player
 
Quote:

Originally Posted by Xellath (Post 880563)
Try that, not tested.

aim_ ,fy_
those map doesn't work with that event.
so i need to script with roundtime = 0:00

ConnorMcLeod 07-24-2009 09:50

Re: round time = 0:00 kill all player
 
Try this, let me know if something doesn't work :

PHP Code:

/*    Formatright © 2009, ConnorMcLeod

    RoundEnd SlayAll is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with RoundEnd SlayAll; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <engine>

#define VERSION "0.0.1"

#define TASKID 1534798

new const g_szObjectivesClasses[][] = {
    
"func_bomb_target",
    
"info_bomb_target",
    
"hostage_entity",
    
"monster_scientist",
    
"func_hostage_rescue",
    
"info_hostage_rescue",
    
"info_vip_start",
    
"func_vip_safetyzone",
    
"func_escapezone"
}

new 
g_flRoundTime
new gmsgSayText

new g_pCvarRespawn
new g_pCvarRoundTime
 
public plugin_init()
{
    
register_plugin("RoundEnd SlayAll"VERSION"ConnorMcLeod")

    new const 
szObjectivesClasses[][] = { "func_bomb_target""info_bomb_target""hostage_entity""monster_scientist",
        
"func_hostage_rescue""info_hostage_rescue""info_vip_start""func_vip_safetyzone""func_escapezone" }

    new 
bMapHasObjectives
    
for(new i=0i<sizeof(szObjectivesClasses); i++)
    {
        if( 
find_ent_by_class(-1g_szObjectivesClasses[i]) )
        {
            
register_logevent("Logevent_Round_End"2"0=World triggered""1=Round_End")
            
bMapHasObjectives true
            
break
        }
    }

    if( !
bMapHasObjectives )
    {
        
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0")
        
register_logevent("LogEvent_Round_Start"2"0=World triggered""1=Round_Start")
    }

    
gmsgSayText get_user_msgid("SayText")
    
g_pCvarRespawn get_cvar_pointer("amx_respawn")
    
g_pCvarRoundTime get_cvar_pointer("mp_roundtime")
}

public 
Logevent_Round_End()
{
    
KillPlayers()
}

public 
Event_HLTV_New_Round()
{
    
remove_task(TASKID)
    
g_flRoundTime floatmulfloatclamp(get_pcvar_float(g_pCvarRoundTime), 1.09.0) , 60.0) - 1.0
}

public 
LogEvent_Round_Start()
{
    
set_task(g_flRoundTime"Logevent_Round_End"TASKID)
}

KillPlayers()
{
    if( !
g_pCvarRespawn || get_pcvar_num(g_pCvarRespawn) )
    {
        return
    }

    new 
iPlayers[32], iNum
    get_players
(iPlayersiNum"ah")

    for(new 
ii<iNum i++)
    {
        
user_kill(iPlayers[i], 1)
    }

    static 
szMsg[] = "^x04[Round Control] Round End, All players must be dead"

    
message_begin(MSG_BROADCASTgmsgSayText
    
write_byte(1)
    
write_string(szMsg)
    
message_end()



biscuit628 07-25-2009 00:14

Re: round time = 0:00 kill all player
 
ConnorMcLeod:
i change a little bit
and i get some problem.
the msg will show many time.
if 5player still alive on 0:00
the msg will print 5 times.
and sometimes the plugin will kill player on 0:30,1:00,,

PHP Code:

#include <amxmodx>
#include <engine>

#define VERSION "0.0.1"

#define TASKID 1534798

new const g_szObjectivesClasses[][] = {
    
"func_bomb_target",
    
"info_bomb_target",
    
"hostage_entity",
    
"monster_scientist",
    
"func_hostage_rescue",
    
"info_hostage_rescue",
    
"info_vip_start",
    
"func_vip_safetyzone",
    
"func_escapezone"
}

new 
Float:g_flRoundTime
new gmsgSayText

new g_pCvarRespawn
new g_pCvarRoundTime
 
public plugin_init()
{
    
register_plugin("RoundEnd SlayAll"VERSION"ConnorMcLeod")


    new 
bMapHasObjectives
    
for(new i=0i<sizeof(g_szObjectivesClasses); i++)
    {
        if( 
find_ent_by_class(-1g_szObjectivesClasses[i]) )
        {
            
register_logevent("Logevent_Round_End"2"0=World triggered""1=Round_End")
            
bMapHasObjectives true
            
break
         }
    }

        if( !
bMapHasObjectives )
        {
            
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0")
            
register_logevent("LogEvent_Round_Start"2"0=World triggered""1=Round_Start")
        }

    
register_event("SendAudio","Teamwin_removetask","a","2&%!MRAD_terwin","2&%!MRAD_ctwin","2&%!MRAD_rounddraw"

        
gmsgSayText get_user_msgid("SayText")
        
g_pCvarRespawn get_cvar_pointer("amx_respawn")
        
g_pCvarRoundTime get_cvar_pointer("mp_roundtime")
}

public 
Logevent_Round_End()
{
        
KillPlayers()
}

public 
Teamwin_removetask()
{
        
remove_task(TASKID)
}

public 
Event_HLTV_New_Round()
{
        
remove_task(TASKID)
        
g_flRoundTime floatmulfloatclamp(get_pcvar_float(g_pCvarRoundTime), 1.09.0) , 60.0) - 1.0
}

public 
LogEvent_Round_Start()
{
        
set_task(g_flRoundTime"Logevent_Round_End"TASKID)
}

KillPlayers()
{
        if(
get_pcvar_num(g_pCvarRespawn) )
        {
            return
        }

        static 
szMsg[] = "^x04[Round Control] Round End, All players must be dead"

        
message_begin(MSG_BROADCASTgmsgSayText
        
write_byte(1)
        
write_string(szMsg)
        
message_end()

        new 
iPlayers[32], iNum
        get_players
(iPlayersiNum"ah")

        for(new 
ii<iNum i++)
       {
            
user_kill(iPlayers[i], 1)
        }




cs1.7 07-26-2009 17:39

Re: round time = 0:00 kill all player
 
will the auto-kill count in player's stats?

Xellath 07-27-2009 06:05

Re: round time = 0:00 kill all player
 
Quote:

Originally Posted by cs1.7 (Post 882468)
will the auto-kill count in player's stats?

AFAIK, it will not count as a death. You could do it like this to increase death count:
PHP Code:

user_kill(id1); 

I've tested that and the death count increased again after round start.

cs1.7 07-27-2009 06:52

Re: round time = 0:00 kill all player
 
i just want a plugin that kills all players when round time over. For aim, fy , etc maps or csdm. currently no such plugin works. they are all bugged. death should not be added.:)


edit:

error compiling connors code:


Code:

// by the AMX Mod X Dev Team


//// roundend_slay.sma
// C:\Program Files\Valve\HLServer\cstrike\addons\amxmodx\scripting\roundend_sla
y.sma(70) : warning 204: symbol is assigned a value that is never used: "szObjec
tivesClasses"
// C:\Program Files\Valve\HLServer\cstrike\addons\amxmodx\scripting\roundend_sla
y.sma(80 -- 81) : warning 213: tag mismatch
// C:\Program Files\Valve\HLServer\cstrike\addons\amxmodx\scripting\roundend_sla
y.sma(85) : warning 213: tag mismatch
// Header size:            616 bytes
// Code size:            1864 bytes
// Data size:            2504 bytes
// Stack/heap size:      16384 bytes; estimated max. usage=177 cells (708 bytes)

// Total requirements:  21368 bytes
//
// 3 Warnings.
// Done.
//
// Compilation Time: 0,3 sec
// ----------------------------------------

Press enter to exit ...


biscuit628 07-27-2009 08:56

Re: round time = 0:00 kill all player
 
cs1.7:
i update the code myself
and the plugin work perfect now.
PHP Code:

#include <amxmodx>
#include <engine>

#define VERSION "0.0.1"

#define TASKID 13213213

new Float:g_flRoundTime
new gmsgSayText

new g_pCvarRespawn
new g_pCvarRoundTime
 
public plugin_init()
{
    
register_plugin("RoundEnd SlayAll"VERSION"ConnorMcLeod")


    
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0")
    
register_logevent("LogEvent_Round_Start"2"0=World triggered""1=Round_Start")
    
register_logevent("Teamwin_removetask"3"2=Planted_The_Bomb")

    
register_event("SendAudio","Teamwin_removetask","a","2&%!MRAD_terwin","2&%!MRAD_ctwin","2&%!MRAD_rounddraw"

    
gmsgSayText get_user_msgid("SayText")
    
g_pCvarRespawn get_cvar_pointer("amx_respawn")
    
g_pCvarRoundTime get_cvar_pointer("mp_roundtime")
}

public 
Logevent_Round_End()
{
        
KillPlayers()
}

public 
Teamwin_removetask()
{
        
remove_task(TASKID)
}

public 
Event_HLTV_New_Round()
{
        
remove_task(TASKID)
        
g_flRoundTime floatmulget_pcvar_float(g_pCvarRoundTime) , 60.0) + 1.0
}

public 
LogEvent_Round_Start()
{
        
set_task(g_flRoundTime"Logevent_Round_End"TASKID)
}

KillPlayers()
{
        if(
get_pcvar_num(g_pCvarRespawn) )
        {
            return
        }
        static 
msg[100]
    
format(msg,99,"^x04[Round Control]Times up.All player must be dead")
    
client_color(0,1,msg)

        new 
iPlayers[32], iNum
        get_players
(iPlayersiNum"ah")

        for(new 
ii<iNum i++)
       {
            
user_kill(iPlayers[i], 1)
        }

}  

public 
client_color(playeridcoloridmsg[])
{
    
message_begin((playerid== 0) ? MSG_ALL MSG_ONE,gmsgSayText,_,playerid
    
write_byte(colorid)
    
write_string(msg)
    
message_end()




All times are GMT -4. The time now is 18:25.

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