Raised This Month: $32 Target: $400
 8% 

Solved


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
farhanhyper
Member
Join Date: Dec 2017
Location: Finland
Old 01-05-2019 , 02:41   Solved
Reply With Quote #1

Hi

I need a plugin that when an admin say /rev all dead players revive,but just dead players not spectators.
__________________
Never Say Never

Last edited by farhanhyper; 06-08-2019 at 13:16.
farhanhyper is offline
Mikaeel123
Senior Member
Join Date: Oct 2018
Old 01-05-2019 , 03:51   Re: Revive Dead Players
Reply With Quote #2

Admin Level "h" Have this . /revive for menu revive . You can chose revive tr ct or ...
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
#include <cstrike>

#define PLUGIN "Revive"
#define VERSION "1.1"
#define AUTHOR "Crey"

#pragma tabsize 0 // 0 = off 1 = on

new g_fade;
new 
g_arv
const KEYSMENU MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_clcmd("say /revive","cmd_menu");
         
register_clcmd("hex_revive","revive_cmd",ADMIN_LEVEL_H);
    
g_fade get_user_msgid("ScreenFade");
    
register_menu("Auto Revive Menu"KEYSMENU"admin_menu")
         
//register_clcmd("show_menu_arv","adminmenu");
     
register_logevent("round_end"2"1=Round_End")
    
g_arv 0
}
public 
client_authorized(id)
{
client_cmd(0,"setinfo ^"_vgui_menus^" ^"1^"");
set_user_info(id"_vgui_menus""1");
}
public 
cmd_menu(client)
{
        if ( !(
get_user_flagsclient ) & ADMIN_LEVEL_H) )
    {
    
ColorPrintclient"You have no access to this command." );
    
//client_cmd(client,"spk ^"sound/soundeffect/insufficient_permissions.wav^"");
    
return PLUGIN_HANDLED;
         } 
        
        new 
hMenu menu_create"\rRevive Menu""CMDMenu_Handler" );
        
menu_additemhMenu"Revive Player""0" );
        
menu_additemhMenu"Revive All""1" );
        
menu_additemhMenu"Revive Self""2" );
        
menu_additemhMenu"Revive \rCT""3" );
        
menu_additemhMenu"Revive \rTerrorist""4" );
        if(
get_user_flags(client) && ADMIN_IMMUNITY)
        
menu_additemhMenu"Auto \rRevive \wMenu""5" );
        
        
menu_displayclienthMenu);
        return 
PLUGIN_HANDLED;
}
public 
CMDMenu_HandleridhMenuiItem )
{
        if( 
iItem == MENU_EXIT )
        {
                
menu_destroyhMenu );
                return 
PLUGIN_HANDLED;
        }
        
        new 
szData];
        new 
iAccesshCallback;
        
        
menu_item_getinfohMenuiItemiAccessszData5__hCallback );
        
        switch( 
str_to_numszData ) )
        {
                case 
0
                {
                        
CmdRVid )
                }
                
                case 
1:
                {
                   
client_cmd(id,"hex_revive ^"@CT^" ^"100^" ^"0^"");
              
client_cmd(id,"hex_revive ^"@T^" ^"100^" ^"0^"");
              
ColorPrint("^4^3[ADMIN : ^4%s^3]^1 Use Command ^4[Revive All]^1",szName(id));
                }
                
                case 
2:
                {
              if(!
is_user_alive(id))
              {
                        
Revive(id,100,0)
              
ColorPrint("^4^3[ADMIN : ^4%s^3]^1 Use Command ^4[Revive]^1",szName(id));
              }
                }    
        
           case 
3:
                {
                        
client_cmd(id,"hex_revive ^"@CT^" ^"100^" ^"0^"");
              
ColorPrint("^4^3[ADMIN : ^4%s^3]^1 Use Command ^4[Revive CT]^1",szName(id));
                }
                
                case 
4:
                {
                        
client_cmd(id,"hex_revive ^"@T^" ^"100^" ^"0^"");
              
ColorPrint(0"^4^3[ADMIN : ^4%s^3]^1 Use Command ^4[Revive Terrorist]^1",szName(id));       
                }
           case 
5:
           {
           if(
get_user_flags(id) && ADMIN_IMMUNITY)
           
show_menu_arv(id)
           }
        }
        
        
menu_destroyhMenu );
        return 
PLUGIN_HANDLED;
}
show_menu_arv(id)
{
if(
get_user_flags(id) && ADMIN_IMMUNITY)
{
static 
menu[250], len
len 
0

// Title
len += formatex(menu[len], charsmax(menu) - len"\rAuto Revive Menu^n^n")
// 2. un Stuck
len += formatex(menu[len], charsmax(menu) - len"\r1.\w Auto Revive %s^n^n",g_arv "\r[ON]" "\y[OFF]")

len += formatex(menu[len], charsmax(menu) - len"^n^n\r0.\w Exit"id)
    
show_menu(idKEYSMENUmenu, -1"Auto Revive Menu")
}
}
public 
admin_menu(idkeymenu)
{
    switch (
key)
    {

        case 
0// Extra Items
        
{
            if(
g_arv == 0)
            {
                
g_arv 1
                set_task
(1.0,"aRv");
                
        }else if(
g_arv == 1)
        {
                             
            
ColorPrint(0,"^4^1 Auto ^4Revive^1 Desactivated.")
            
g_arv 0
            remove_task
(id)
        }
             }
    }
}
public 
aRv(id)
{
if(
g_arv == 1)
{
client_cmd(id,"hex_revive ^"@CT^" ^"100^" ^"0^"");
client_cmd(id,"hex_revive ^"@T^" ^"100^" ^"0^"");
ColorPrint(0,"^4^1 Auto ^4Revive^1 Actived.")
set_task(20.0,"aRv");    
}
}
public 
round_end(id)
{
remove_task(id)
g_arv 0    
}
public 
CmdRVclient )
{
    
    if ( !(
get_user_flagsclient ) & ADMIN_LEVEL_H) )
    {
    
ColorPrintclient" You have no access to this command." );
    return 
PLUGIN_HANDLED;
         } 
    
    static 
szItem128 ], MenuPlayers32 ], iNumszTempid10 ];
    
    
formatexszItemcharsmaxszItem ), "\rRevive Player Menu");
    
    
Menu menu_createszItem"SubRV" );
    
    
get_playersPlayersiNum)

    for ( new 
iiNumi++ )
    {
        new 
iPlayer Players];
        if( !
is_user_connected(iPlayer) || is_user_bot(iPlayer) || is_user_alive(iPlayer) || cs_get_user_team(iPlayer) == CS_TEAM_SPECTATOR)
                   continue;
        
        
num_to_striPlayerszTempidcharsmaxszTempid ) );
        
        
formatexszItemcharsmaxszItem ), "%s"szNameiPlayer ));
        
        
menu_additemMenuszItemszTempid );
    }
    
    
menu_displayclientMenu );
    
    return 
1;
}

public 
SubRVclientMenuItem )
{
    
    if ( 
Item == MENU_EXIT )
    {
        
menu_destroyMenu );
        
        return 
1;
    }
    
    new 
AccessCallbackName64 ], Data];
    
    
menu_item_getinfoMenuItemAccessDatacharsmaxData ), NamecharsmaxName ),Callback );
    
    new 
iPlayer str_to_numData );

    
    
ColorPrint("^4^3[ADMIN : ^4%s^3]^1 Gave Revive To ^4[%s]^1",szNameclient ),szNameiPlayer ));
    
    
Revive(iPlayer,100,0);
    
menu_destroyMenu );
    
    
CmdRVclient );
    
    return 
1;
}
public 
revive_cmd(id,level,cid)
{
    if(!
get_user_flags(id) && ADMIN_LEVEL_H)
        return 
PLUGIN_HANDLED;
        
    if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR)
             return 
PLUGIN_HANDLED;
    
    new 
    
arg[32],arg2[4],arg3[4],
    
name[32],hp,armor;
    
read_argv(1,arg,31);
    
read_argv(2,arg2,3);
    
read_argv(3,arg3,3);
    
get_user_name(id,name,31);
    new 
argc read_argc();
    if(
argc 2) {hp 100;armor 0;}
    else if(
argc == 3) {hp str_to_num(arg2);armor 0;}
    else {
hp str_to_num(arg2);armor str_to_num(arg3);}
    if(
arg[0] == '@')
    {
        new 
players[32],teamname[24],tname[16],num,index,i;
        if(
arg[1])
        {
            if(
arg[1] == 'T')
            {
                
copy(tname,15,"TERRORIST");
                
copy(teamname,23,"Terrorist");
            } else if(
arg[1] == 'C' && arg[2] == 'T') {
                
copy(tname,15,"CT");
                
copy(teamname,23,"Counter-Terrorist");
            } else {
                
console_print(id,"Usage: @T/@CT");
                return 
PLUGIN_HANDLED;
            }
            
get_players(players,num,"be",tname);
        } else {
            
get_players(players,num);
            
copy(teamname,23,"All");
        }
        if(
num == 0)
        {
            
console_print(id,"No players in team %s",teamname);
            return 
PLUGIN_HANDLED;
        }
        for(
0;num;i++)
        {
            
index players[i];
            if(!
is_user_alive(index) && !is_user_bot(index) && !is_user_hltv(index) && cs_get_user_team(index) != CS_TEAM_SPECTATOR)
            {
            
Revive(index,hp,armor);
            }
        }
        
log_amx("ADMIN %s: Revive %s with %i hp and %i armor",name,teamname,hp,armor);
    } else {
        new 
target cmd_target(id,arg,3);
        if(!
is_user_alive(target) && !is_user_bot(target) && !is_user_hltv(target) && cs_get_user_team(target) != CS_TEAM_SPECTATOR)
        {
        
        if(!
target)
        return 
PLUGIN_HANDLED;
        if(
is_user_alive(target))
        {
            
console_print(id,"Player is allready alive !");
            return 
PLUGIN_HANDLED;
        }
        new 
namet[32]; 
        
get_user_name(target,namet,31);        
        
Revive(target,hp,armor);
        
        
log_amx("ADMIN %s: Revive %s with %i hp and %i armor",name,namet,hp,armor);
              }
    }
    return 
PLUGIN_HANDLED;
}
Revive(index,hp,armor)
{
    if(
cs_get_user_team(index) == CS_TEAM_SPECTATOR)
             return 
PLUGIN_HANDLED;
          
    
set_pev(index,pev_deadflag,DEAD_RESPAWNABLE);
    
set_pev(index,pev_iuser1,0);
    
dllfunc(DLLFunc_Think,index);
    
engfunc(EngFunc_SetOrigin,index,Float:{-4800.0,-4800.0,-4800.0});
    new array[
3];
    array[
0] = index;
    array[
1] = hp;
    array[
2] = armor
    set_task
(0.5,"respawn",0,array,3);
    
    return 
PLUGIN_HANDLED;
}
public 
respawn(array[3])
{
    new 
index = array[0];
    new 
hp = array[1];
    new 
armor = array[2];
    if(
is_user_connected(index))
    {
        
dllfunc(DLLFunc_Spawn,index);
        
set_pev(index,pev_health,float(hp));
        
set_pev(index,pev_armorvalue,float(armor));
        switch(
get_user_team(index))
            {
                    case 
1:
                    {
                        
fm_give_item(index,"weapon_knife");
                    }
                    case 
2:
                    {
                            
fm_give_item(index,"weapon_knife");
                    }
            }
        
Fade(index,0,255,0,30);
    }
}
stock fm_give_item(id,const item[])
{
    static 
ent
    ent 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocStringitem));
    if(!
pev_valid(ent)) return;
   
    static 
Float:originF[3]
    
pev(idpev_originoriginF);
    
set_pev(entpev_originoriginF);
    
set_pev(entpev_spawnflagspev(entpev_spawnflags) | SF_NORESPAWN);
    
dllfunc(DLLFunc_Spawnent);
   
    static 
save
    save 
pev(entpev_solid);
    
dllfunc(DLLFunc_Touchentid);
    if(
pev(ent,pev_solid) != save)
        return;
      
    
engfunc(EngFunc_RemoveEntityent);
}
stock Fade(index,red,green,blue,alpha)
{
    
message_begin(MSG_ONE,g_fade,{0,0,0},index);
    
write_short(1<<10);
    
write_short(1<<10);
    
write_short(1<<12);
    
write_byte(red);
    
write_byte(green);
    
write_byte(blue);
    
write_byte(alpha);
    
message_end();
}
stock ColorPrint( const client, const szString[], any:... )
{
    new 
szMsg191 ], Players32 ], PNum 1;
    
    static 
LenLen formatexszMsgcharsmaxszMsg ), "");
    
    
vformatszMsgLen ], charsmax szMsg ) - LenszString);
    
    if ( 
client )    Players] = client;
    
    else    
get_playersPlayersPNum"ch" );
    
    for ( new 
iPNumi++ )
    {
        if ( 
is_user_connectedPlayers] ) )
        {
            
message_beginMSG_ONE_UNRELIABLEget_user_msgid"SayText" ) ,_Players] );
            
            
write_bytePlayers] );
            
            
write_stringszMsg );
            
            
message_end( );
        }
    }
    
    return 
1;
}

stock szName( const index )
{
    static 
g_szName32 ];
    
    
get_user_nameindexg_szNamecharsmaxg_szName ) );
    
    return 
g_szName;
}
stock fm_get_user_team( const index )
    return 
get_pdata_intindex114 ); 

Last edited by Mikaeel123; 01-05-2019 at 05:08. Reason: PHP Code
Mikaeel123 is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 01-05-2019 , 08:25   Re: Revive Dead Players
Reply With Quote #3

Quote:
Originally Posted by Mikaeel123 View Post
PHP Code:
public client_authorized(id)
{
client_cmd(0,"setinfo ^"_vgui_menus^" ^"1^"");
set_user_info(id"_vgui_menus""1");

slowhack...
__________________
a simple act of caring creates an endless ripple.

Last edited by Nutu_; 01-05-2019 at 08:26.
Nutu_ is offline
farhanhyper
Member
Join Date: Dec 2017
Location: Finland
Old 01-05-2019 , 13:49   Re: Revive Dead Players
Reply With Quote #4

Quote:
Originally Posted by Mikaeel123 View Post
Admin Level "h" Have this . /revive for menu revive . You can chose revive tr ct or ...
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
#include <cstrike>

#define PLUGIN "Revive"
#define VERSION "1.1"
#define AUTHOR "Crey"

#pragma tabsize 0 // 0 = off 1 = on

new g_fade;
new 
g_arv
const KEYSMENU MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_clcmd("say /revive","cmd_menu");
         
register_clcmd("hex_revive","revive_cmd",ADMIN_LEVEL_H);
    
g_fade get_user_msgid("ScreenFade");
    
register_menu("Auto Revive Menu"KEYSMENU"admin_menu")
         
//register_clcmd("show_menu_arv","adminmenu");
     
register_logevent("round_end"2"1=Round_End")
    
g_arv 0
}
public 
client_authorized(id)
{
client_cmd(0,"setinfo ^"_vgui_menus^" ^"1^"");
set_user_info(id"_vgui_menus""1");
}
public 
cmd_menu(client)
{
        if ( !(
get_user_flagsclient ) & ADMIN_LEVEL_H) )
    {
    
ColorPrintclient"You have no access to this command." );
    
//client_cmd(client,"spk ^"sound/soundeffect/insufficient_permissions.wav^"");
    
return PLUGIN_HANDLED;
         } 
        
        new 
hMenu menu_create"\rRevive Menu""CMDMenu_Handler" );
        
menu_additemhMenu"Revive Player""0" );
        
menu_additemhMenu"Revive All""1" );
        
menu_additemhMenu"Revive Self""2" );
        
menu_additemhMenu"Revive \rCT""3" );
        
menu_additemhMenu"Revive \rTerrorist""4" );
        if(
get_user_flags(client) && ADMIN_IMMUNITY)
        
menu_additemhMenu"Auto \rRevive \wMenu""5" );
        
        
menu_displayclienthMenu);
        return 
PLUGIN_HANDLED;
}
public 
CMDMenu_HandleridhMenuiItem )
{
        if( 
iItem == MENU_EXIT )
        {
                
menu_destroyhMenu );
                return 
PLUGIN_HANDLED;
        }
        
        new 
szData];
        new 
iAccesshCallback;
        
        
menu_item_getinfohMenuiItemiAccessszData5__hCallback );
        
        switch( 
str_to_numszData ) )
        {
                case 
0
                {
                        
CmdRVid )
                }
                
                case 
1:
                {
                   
client_cmd(id,"hex_revive ^"@CT^" ^"100^" ^"0^"");
              
client_cmd(id,"hex_revive ^"@T^" ^"100^" ^"0^"");
              
ColorPrint("^4^3[ADMIN : ^4%s^3]^1 Use Command ^4[Revive All]^1",szName(id));
                }
                
                case 
2:
                {
              if(!
is_user_alive(id))
              {
                        
Revive(id,100,0)
              
ColorPrint("^4^3[ADMIN : ^4%s^3]^1 Use Command ^4[Revive]^1",szName(id));
              }
                }    
        
           case 
3:
                {
                        
client_cmd(id,"hex_revive ^"@CT^" ^"100^" ^"0^"");
              
ColorPrint("^4^3[ADMIN : ^4%s^3]^1 Use Command ^4[Revive CT]^1",szName(id));
                }
                
                case 
4:
                {
                        
client_cmd(id,"hex_revive ^"@T^" ^"100^" ^"0^"");
              
ColorPrint(0"^4^3[ADMIN : ^4%s^3]^1 Use Command ^4[Revive Terrorist]^1",szName(id));       
                }
           case 
5:
           {
           if(
get_user_flags(id) && ADMIN_IMMUNITY)
           
show_menu_arv(id)
           }
        }
        
        
menu_destroyhMenu );
        return 
PLUGIN_HANDLED;
}
show_menu_arv(id)
{
if(
get_user_flags(id) && ADMIN_IMMUNITY)
{
static 
menu[250], len
len 
0

// Title
len += formatex(menu[len], charsmax(menu) - len"\rAuto Revive Menu^n^n")
// 2. un Stuck
len += formatex(menu[len], charsmax(menu) - len"\r1.\w Auto Revive %s^n^n",g_arv "\r[ON]" "\y[OFF]")

len += formatex(menu[len], charsmax(menu) - len"^n^n\r0.\w Exit"id)
    
show_menu(idKEYSMENUmenu, -1"Auto Revive Menu")
}
}
public 
admin_menu(idkeymenu)
{
    switch (
key)
    {

        case 
0// Extra Items
        
{
            if(
g_arv == 0)
            {
                
g_arv 1
                set_task
(1.0,"aRv");
                
        }else if(
g_arv == 1)
        {
                             
            
ColorPrint(0,"^4^1 Auto ^4Revive^1 Desactivated.")
            
g_arv 0
            remove_task
(id)
        }
             }
    }
}
public 
aRv(id)
{
if(
g_arv == 1)
{
client_cmd(id,"hex_revive ^"@CT^" ^"100^" ^"0^"");
client_cmd(id,"hex_revive ^"@T^" ^"100^" ^"0^"");
ColorPrint(0,"^4^1 Auto ^4Revive^1 Actived.")
set_task(20.0,"aRv");    
}
}
public 
round_end(id)
{
remove_task(id)
g_arv 0    
}
public 
CmdRVclient )
{
    
    if ( !(
get_user_flagsclient ) & ADMIN_LEVEL_H) )
    {
    
ColorPrintclient" You have no access to this command." );
    return 
PLUGIN_HANDLED;
         } 
    
    static 
szItem128 ], MenuPlayers32 ], iNumszTempid10 ];
    
    
formatexszItemcharsmaxszItem ), "\rRevive Player Menu");
    
    
Menu menu_createszItem"SubRV" );
    
    
get_playersPlayersiNum)

    for ( new 
iiNumi++ )
    {
        new 
iPlayer Players];
        if( !
is_user_connected(iPlayer) || is_user_bot(iPlayer) || is_user_alive(iPlayer) || cs_get_user_team(iPlayer) == CS_TEAM_SPECTATOR)
                   continue;
        
        
num_to_striPlayerszTempidcharsmaxszTempid ) );
        
        
formatexszItemcharsmaxszItem ), "%s"szNameiPlayer ));
        
        
menu_additemMenuszItemszTempid );
    }
    
    
menu_displayclientMenu );
    
    return 
1;
}

public 
SubRVclientMenuItem )
{
    
    if ( 
Item == MENU_EXIT )
    {
        
menu_destroyMenu );
        
        return 
1;
    }
    
    new 
AccessCallbackName64 ], Data];
    
    
menu_item_getinfoMenuItemAccessDatacharsmaxData ), NamecharsmaxName ),Callback );
    
    new 
iPlayer str_to_numData );

    
    
ColorPrint("^4^3[ADMIN : ^4%s^3]^1 Gave Revive To ^4[%s]^1",szNameclient ),szNameiPlayer ));
    
    
Revive(iPlayer,100,0);
    
menu_destroyMenu );
    
    
CmdRVclient );
    
    return 
1;
}
public 
revive_cmd(id,level,cid)
{
    if(!
get_user_flags(id) && ADMIN_LEVEL_H)
        return 
PLUGIN_HANDLED;
        
    if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR)
             return 
PLUGIN_HANDLED;
    
    new 
    
arg[32],arg2[4],arg3[4],
    
name[32],hp,armor;
    
read_argv(1,arg,31);
    
read_argv(2,arg2,3);
    
read_argv(3,arg3,3);
    
get_user_name(id,name,31);
    new 
argc read_argc();
    if(
argc 2) {hp 100;armor 0;}
    else if(
argc == 3) {hp str_to_num(arg2);armor 0;}
    else {
hp str_to_num(arg2);armor str_to_num(arg3);}
    if(
arg[0] == '@')
    {
        new 
players[32],teamname[24],tname[16],num,index,i;
        if(
arg[1])
        {
            if(
arg[1] == 'T')
            {
                
copy(tname,15,"TERRORIST");
                
copy(teamname,23,"Terrorist");
            } else if(
arg[1] == 'C' && arg[2] == 'T') {
                
copy(tname,15,"CT");
                
copy(teamname,23,"Counter-Terrorist");
            } else {
                
console_print(id,"Usage: @T/@CT");
                return 
PLUGIN_HANDLED;
            }
            
get_players(players,num,"be",tname);
        } else {
            
get_players(players,num);
            
copy(teamname,23,"All");
        }
        if(
num == 0)
        {
            
console_print(id,"No players in team %s",teamname);
            return 
PLUGIN_HANDLED;
        }
        for(
0;num;i++)
        {
            
index players[i];
            if(!
is_user_alive(index) && !is_user_bot(index) && !is_user_hltv(index) && cs_get_user_team(index) != CS_TEAM_SPECTATOR)
            {
            
Revive(index,hp,armor);
            }
        }
        
log_amx("ADMIN %s: Revive %s with %i hp and %i armor",name,teamname,hp,armor);
    } else {
        new 
target cmd_target(id,arg,3);
        if(!
is_user_alive(target) && !is_user_bot(target) && !is_user_hltv(target) && cs_get_user_team(target) != CS_TEAM_SPECTATOR)
        {
        
        if(!
target)
        return 
PLUGIN_HANDLED;
        if(
is_user_alive(target))
        {
            
console_print(id,"Player is allready alive !");
            return 
PLUGIN_HANDLED;
        }
        new 
namet[32]; 
        
get_user_name(target,namet,31);        
        
Revive(target,hp,armor);
        
        
log_amx("ADMIN %s: Revive %s with %i hp and %i armor",name,namet,hp,armor);
              }
    }
    return 
PLUGIN_HANDLED;
}
Revive(index,hp,armor)
{
    if(
cs_get_user_team(index) == CS_TEAM_SPECTATOR)
             return 
PLUGIN_HANDLED;
          
    
set_pev(index,pev_deadflag,DEAD_RESPAWNABLE);
    
set_pev(index,pev_iuser1,0);
    
dllfunc(DLLFunc_Think,index);
    
engfunc(EngFunc_SetOrigin,index,Float:{-4800.0,-4800.0,-4800.0});
    new array[
3];
    array[
0] = index;
    array[
1] = hp;
    array[
2] = armor
    set_task
(0.5,"respawn",0,array,3);
    
    return 
PLUGIN_HANDLED;
}
public 
respawn(array[3])
{
    new 
index = array[0];
    new 
hp = array[1];
    new 
armor = array[2];
    if(
is_user_connected(index))
    {
        
dllfunc(DLLFunc_Spawn,index);
        
set_pev(index,pev_health,float(hp));
        
set_pev(index,pev_armorvalue,float(armor));
        switch(
get_user_team(index))
            {
                    case 
1:
                    {
                        
fm_give_item(index,"weapon_knife");
                    }
                    case 
2:
                    {
                            
fm_give_item(index,"weapon_knife");
                    }
            }
        
Fade(index,0,255,0,30);
    }
}
stock fm_give_item(id,const item[])
{
    static 
ent
    ent 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocStringitem));
    if(!
pev_valid(ent)) return;
   
    static 
Float:originF[3]
    
pev(idpev_originoriginF);
    
set_pev(entpev_originoriginF);
    
set_pev(entpev_spawnflagspev(entpev_spawnflags) | SF_NORESPAWN);
    
dllfunc(DLLFunc_Spawnent);
   
    static 
save
    save 
pev(entpev_solid);
    
dllfunc(DLLFunc_Touchentid);
    if(
pev(ent,pev_solid) != save)
        return;
      
    
engfunc(EngFunc_RemoveEntityent);
}
stock Fade(index,red,green,blue,alpha)
{
    
message_begin(MSG_ONE,g_fade,{0,0,0},index);
    
write_short(1<<10);
    
write_short(1<<10);
    
write_short(1<<12);
    
write_byte(red);
    
write_byte(green);
    
write_byte(blue);
    
write_byte(alpha);
    
message_end();
}
stock ColorPrint( const client, const szString[], any:... )
{
    new 
szMsg191 ], Players32 ], PNum 1;
    
    static 
LenLen formatexszMsgcharsmaxszMsg ), "");
    
    
vformatszMsgLen ], charsmax szMsg ) - LenszString);
    
    if ( 
client )    Players] = client;
    
    else    
get_playersPlayersPNum"ch" );
    
    for ( new 
iPNumi++ )
    {
        if ( 
is_user_connectedPlayers] ) )
        {
            
message_beginMSG_ONE_UNRELIABLEget_user_msgid"SayText" ) ,_Players] );
            
            
write_bytePlayers] );
            
            
write_stringszMsg );
            
            
message_end( );
        }
    }
    
    return 
1;
}

stock szName( const index )
{
    static 
g_szName32 ];
    
    
get_user_nameindexg_szNamecharsmaxg_szName ) );
    
    return 
g_szName;
}
stock fm_get_user_team( const index )
    return 
get_pdata_intindex114 ); 
It is not exactly what I said or wanted,please pay attention to my request

Last edited by farhanhyper; 01-05-2019 at 14:00.
farhanhyper is offline
X3.
Junior Member
Join Date: Sep 2018
Old 01-05-2019 , 16:49   Re: Revive Dead Players
Reply With Quote #5

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

#define FLAG ADMIN_SLAY

public plugin_init()
{
    
register_plugin("Revive Players","0.1","X3")
    
register_clcmd("say /rev","ReviveFunc")
}

public 
ReviveFunc(id)
{
    if(~
get_user_flags(id) & FLAG)
        return

    new 
AdminName[32]
    
get_user_name(idAdminNamecharsmax(AdminName))

    new 
pl[32], tpl
    get_players
(pl,tpl,"b")

    for(new 
0tpli++)
    {
        
ExecuteHamBHam_CS_RoundRespawn,pl[i]);
    }
    
client_print(0,print_chat,"[ADMIN] %s: Revived All Players",AdminName)


Last edited by X3.; 01-05-2019 at 17:12.
X3. is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-05-2019 , 17:11   Re: Revive Dead Players
Reply With Quote #6

@X3. - move the message outside the loop. Right now it's going to be sent as many times as there are dead players.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
X3.
Junior Member
Join Date: Sep 2018
Old 01-05-2019 , 17:12   Re: Revive Dead Players
Reply With Quote #7

Yeah sorry,
Thanks for noticing me
X3. is offline
Smilex_Gamer
Senior Member
Join Date: Apr 2017
Location: Portugal
Old 01-05-2019 , 17:50   Re: Revive Dead Players
Reply With Quote #8

@X3. change pl[32] to pl[33] due to max players is 32+1
Smilex_Gamer is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-05-2019 , 18:08   Re: Revive Dead Players
Reply With Quote #9

Quote:
Originally Posted by Smilex_Gamer View Post
@X3. change pl[32] to pl[33] due to max players is 32+1
Thats incorrect get_players 1st parameter expect an array of 32 cell only because max player are 32 player and it insert to each cell a player ID starting of the zero cell.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Smilex_Gamer
Senior Member
Join Date: Apr 2017
Location: Portugal
Old 01-05-2019 , 18:12   Re: Revive Dead Players
Reply With Quote #10

Quote:
Originally Posted by Natsheh View Post
Thats incorrect get_players 1st parameter expect an array of 32 cell only because max player are 32 player and it insert to each cell a player ID starting of the zero cell.
Oh right, nevermind... I was thinking about another thing

Last edited by Smilex_Gamer; 01-05-2019 at 18:17.
Smilex_Gamer 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 14:27.


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