AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   KILL ALL (Comman needed) (https://forums.alliedmods.net/showthread.php?t=185384)

Waleed 05-16-2012 14:09

KILL ALL (Comman needed)
 
What is the command for killing all players or all bot
Like we do by pressing key "H" then kill all bots,Is there any console command or anything through module ???

<VeCo> 05-16-2012 14:11

Re: KILL ALL (Comman needed)
 
user_kill

Make a loop trough all players.

Neeeeeeeeeel.- 05-16-2012 21:47

Re: KILL ALL (Comman needed)
 
PHP Code:

new g_maxplayers

public plugin_init( )
{
    
g_maxplayers get_maxplayers( );
    
register_clcmd"say /kill""cmdKill" );
}

public 
cmdKillid )
{
    for( new 
1<= g_maxplayersi++ )
    {
          if( 
is_user_connected) )
                 
user_kill);
    }



EpicMonkey 05-17-2012 01:42

Re: KILL ALL (Comman needed)
 
Quote:

Originally Posted by Neeeeeeeeeel.- (Post 1710396)
PHP Code:

new g_maxplayers

public plugin_init( )
{
    
g_maxplayers get_maxplayers( );
    
register_clcmd"say /kill""cmdKill" );
}

public 
cmdKillid )
{
    for( new 
1<= g_maxplayersi++ )
    {
          if( 
is_user_connected) )
                 
user_kill);
    }



you should check if user is alive , since dead players cant be slain ...

<VeCo> 05-17-2012 06:10

Re: KILL ALL (Comman needed)
 
This is better:

PHP Code:

static players[32],numi,id
get_players
(players,num,"a"// gets only alive players
 
for(i=0;i<num;i++)
{
id players[i]
 
user_kill(id)




All times are GMT -4. The time now is 00:19.

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