Търся Плъгини - /revive, /slap, /ban - за БейсБилдър Мод
-
V.A.L.V.E
Извън линия - Потребител
- Мнения: 445
- Регистриран на: 18 Дек 2016, 22:48
- Се отблагодари: 110 пъти
- Получена благодарност: 71 пъти
- Обратна връзка:
Търсия Плъгини - /revive, /slap, /ban - за БейсБилдър Мод
Това е /revive
Код за потвърждение: Избери целия код
#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(PLUGIN, VERSION, AUTHOR);
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_flags( client ) & ADMIN_LEVEL_H) )
{
ColorPrint( client, "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_additem( hMenu, "Revive Player", "0" );
menu_additem( hMenu, "Revive All", "1" );
menu_additem( hMenu, "Revive Self", "2" );
menu_additem( hMenu, "Revive \rCT", "3" );
menu_additem( hMenu, "Revive \rTerrorist", "4" );
if(get_user_flags(client) && ADMIN_IMMUNITY)
menu_additem( hMenu, "Auto \rRevive \wMenu", "5" );
menu_display( client, hMenu, 0 );
return PLUGIN_HANDLED;
}
public CMDMenu_Handler( id, hMenu, iItem )
{
if( iItem == MENU_EXIT )
{
menu_destroy( hMenu );
return PLUGIN_HANDLED;
}
new szData[ 6 ];
new iAccess, hCallback;
menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, _, _, hCallback );
switch( str_to_num( szData ) )
{
case 0:
{
CmdRV( id )
}
case 1:
{
client_cmd(id,"hex_revive ^"@CT^" ^"100^" ^"0^"");
client_cmd(id,"hex_revive ^"@T^" ^"100^" ^"0^"");
ColorPrint(0 , "^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(0 , "^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(0 , "^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_destroy( hMenu );
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(id, KEYSMENU, menu, -1, "Auto Revive Menu")
}
}
public admin_menu(id, key, menu)
{
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 CmdRV( client )
{
if ( !(get_user_flags( client ) & ADMIN_LEVEL_H) )
{
ColorPrint( client, " You have no access to this command." );
return PLUGIN_HANDLED;
}
static szItem[ 128 ], Menu, Players[ 32 ], iNum, szTempid[ 10 ];
formatex( szItem, charsmax( szItem ), "\rRevive Player Menu");
Menu = menu_create( szItem, "SubRV" );
get_players( Players, iNum)
for ( new i; i < iNum; i++ )
{
new iPlayer = Players[ i ];
if( !is_user_connected(iPlayer) || is_user_bot(iPlayer) || is_user_alive(iPlayer) || cs_get_user_team(iPlayer) == CS_TEAM_SPECTATOR)
continue;
num_to_str( iPlayer, szTempid, charsmax( szTempid ) );
formatex( szItem, charsmax( szItem ), "%s", szName( iPlayer ));
menu_additem( Menu, szItem, szTempid );
}
menu_display( client, Menu );
return 1;
}
public SubRV( client, Menu, Item )
{
if ( Item == MENU_EXIT )
{
menu_destroy( Menu );
return 1;
}
new Access, Callback, Name[ 64 ], Data[ 6 ];
menu_item_getinfo( Menu, Item, Access, Data, charsmax( Data ), Name, charsmax( Name ),Callback );
new iPlayer = str_to_num( Data );
ColorPrint(0 , "^4^3[ADMIN : ^4%s^3]^1 Gave Revive To ^4[%s]^1",szName( client ),szName( iPlayer ));
Revive(iPlayer,100,0);
menu_destroy( Menu );
CmdRV( client );
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(i = 0;i < 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_CreateNamedEntity, engfunc(EngFunc_AllocString, item));
if(!pev_valid(ent)) return;
static Float:originF[3]
pev(id, pev_origin, originF);
set_pev(ent, pev_origin, originF);
set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN);
dllfunc(DLLFunc_Spawn, ent);
static save
save = pev(ent, pev_solid);
dllfunc(DLLFunc_Touch, ent, id);
if(pev(ent,pev_solid) != save)
return;
engfunc(EngFunc_RemoveEntity, ent);
}
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 szMsg[ 191 ], Players[ 32 ], PNum = 1;
static Len; Len = formatex( szMsg, charsmax( szMsg ), "");
vformat( szMsg[ Len ], charsmax ( szMsg ) - Len, szString, 3 );
if ( client ) Players[ 0 ] = client;
else get_players( Players, PNum, "ch" );
for ( new i; i < PNum; i++ )
{
if ( is_user_connected( Players[ i ] ) )
{
message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ) ,_, Players[ i ] );
write_byte( Players[ i ] );
write_string( szMsg );
message_end( );
}
}
return 1;
}
stock szName( const index )
{
static g_szName[ 32 ];
get_user_name( index, g_szName, charsmax( g_szName ) );
return g_szName;
}
stock fm_get_user_team( const index )
return get_pdata_int( index, 114 );
-
thoughtz
Извън линия - Модератор
- Мнения: 585
- Регистриран на: 13 Окт 2016, 00:32
- Местоположение: гр. София
- Се отблагодари: 112 пъти
- Получена благодарност: 79 пъти
- Обратна връзка:
Търсия Плъгини - /revive, /slap, /ban - за БейсБилдър Мод
Код за потвърждение: Избери целия код
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>
#include <colorchat>
#include <fun>
#define PLUGIN "slash commands"
#define VERSION "1"
#define AUTHOR "Amir.H.M"
#define ACCESS ADMIN_BAN
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /r","restart",ACCESS)
register_clcmd("say /a","amxmodmenu",ACCESS)
register_clcmd("say /sm","slapmenu",ACCESS)
register_clcmd("say /sxe","sxemenu",ACCESS)
register_clcmd("say /ss","ssmenu",ACCESS)
register_clcmd("say /map","changemapmenu",ACCESS)
register_clcmd("say /votemap","votemapmenu",ACCESS)
register_clcmd("say /km","kickmenu",ACCESS)
register_clcmd("say /am","adminsmanager",ACCESS)
register_clcmd("say /bm","amx_banmenu",ACCESS)
register_clcmd("say /ubm","amx_unbanmenu",ACCESS)
register_clcmd("say /g","gag",ACCESS)
register_clcmd("say /team","team",ACCESS)
}
public restart(id, level, cid)
{
if(cmd_access(id,level, cid, 1))
{
new name[32]
get_user_info(id, "name", name, 31)
server_cmd("sv_restart 1");
ColorChat(0, TEAM_COLOR,"%s ^1: ^4/r",name)
}
return PLUGIN_HANDLED
}
public amxmodmenu(id, level, cid)
{
if(cmd_access(id,level, cid, 1))
{
new name[32]
get_user_info(id, "name", name, 31)
client_cmd(id,"amxmodmenu");
ColorChat(0, TEAM_COLOR,"%s ^1: ^4/a",name)
ColorChat(0, GREEN,"Server AmxModX Menu",name)
}
return PLUGIN_HANDLED
}
public adminsmanager(id, level, cid)
{
if(cmd_access(id,level, cid, 1))
{
new name[32]
get_user_info(id, "name", name, 31)
client_cmd(id,"say_team /adminsmanager");
ColorChat(0, TEAM_COLOR,"%s ^1: ^4/am",name)
ColorChat(0, GREEN,"Server AdminsManager Menu",name)
}
return PLUGIN_HANDLED
}
public amx_banmenu(id, level, cid)
{
if(cmd_access(id,level, cid, 1))
{
new name[32]
get_user_info(id, "name", name, 31)
client_cmd(id,"amx_banmenu");
ColorChat(0, TEAM_COLOR,"%s ^1: ^4/bm",name)
ColorChat(0, GREEN,"Server Ban Menu",name)
}
return PLUGIN_HANDLED
}
public amx_unbanmenu(id, level, cid)
{
if(cmd_access(id,level, cid, 1))
{
new name[32]
get_user_info(id, "name", name, 31)
client_cmd(id,"amx_unbanmenu");
ColorChat(0, TEAM_COLOR,"%s ^1: ^4/ubm",name)
ColorChat(0, GREEN,"Server UnBan Menu",name)
}
return PLUGIN_HANDLED
}
public slapmenu(id, level, cid)
{
if(cmd_access(id,level, cid, 1))
{
new name[32]
get_user_info(id, "name", name, 31)
client_cmd(id,"amx_slapmenu");
ColorChat(0, TEAM_COLOR,"%s ^1: ^4/sm",name)
ColorChat(0, GREEN,"Server Slap/Slay Menu",name)
}
return PLUGIN_HANDLED
}
public sxemenu(id, level, cid)
{
if(cmd_access(id,level, cid, 1))
{
new name[32]
get_user_info(id, "name", name, 31)
client_cmd(id,"amx_sxe_menu");
ColorChat(0, TEAM_COLOR,"%s ^1: ^4/sxe",name)
ColorChat(0, GREEN,"Server SXE Menu",name)
}
return PLUGIN_HANDLED
}
public ssmenu(id, level, cid)
{
if(cmd_access(id,level, cid, 1))
{
new name[32]
get_user_info(id, "name", name, 31)
client_cmd(id,"amx_sxe_ss_menu");
}
return PLUGIN_HANDLED
}
public changemapmenu(id, level, cid)
{
if(cmd_access(id,level, cid, 1))
{
new name[32]
get_user_info(id, "name", name, 31)
client_cmd(id,"amx_mapmenu");
ColorChat(0, TEAM_COLOR,"%s ^1: ^4/map",name)
ColorChat(0, GREEN,"Server ChangeMap Menu",name)
}
return PLUGIN_HANDLED
}
public votemapmenu(id, level, cid)
{
if(cmd_access(id,level, cid, 1))
{
new name[32]
get_user_info(id, "name", name, 31)
client_cmd(id,"amx_votemapmenu");
ColorChat(0, TEAM_COLOR,"%s ^1: ^4/votemap",name)
ColorChat(0, GREEN,"Server VoteMap Menu",name)
}
return PLUGIN_HANDLED
}
public kickmenu(id, level, cid)
{
if(cmd_access(id,level, cid, 1))
{
new name[32]
get_user_info(id, "name", name, 31)
client_cmd(id,"amx_kickmenu");
ColorChat(0, TEAM_COLOR,"%s ^1: ^4/k",name)
ColorChat(0, GREEN,"Server Kick Menu",name)
}
return PLUGIN_HANDLED
}
public gag(id, level, cid)
{
if(cmd_access(id,level, cid, 1))
{
new name[32]
get_user_info(id, "name", name, 31)
client_cmd(id,"amx_gagmenu");
ColorChat(0, TEAM_COLOR,"%s ^1: ^4/g",name)
ColorChat(0, GREEN,"Server Gag Menu",name)
}
return PLUGIN_HANDLED
}
public team(id, level, cid)
{
if(cmd_access(id,level, cid, 1))
{
new name[32]
get_user_info(id, "name", name, 31)
client_cmd(id,"amx_teammenu");
ColorChat(0, TEAM_COLOR,"%s ^1: ^4/team",name)
ColorChat(0, GREEN,"Server TeamsManager Menu",name)
}
return PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg950\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset136 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1028\\ f0\\ fs16 \n\\ par }
*/
-
Darkness*
Извън линия - Потребител
- Мнения: 28
- Регистриран на: 07 Фев 2019, 00:10
- Се отблагодари: 1 път
- Получена благодарност: 1 път
Търсия Плъгини - /revive, /slap, /ban - за БейсБилдър Мод
Не работи пробвах ?V.A.L.V.E написа: ↑08 Фев 2019, 00:40 Това е /revive
Код за потвърждение: Избери целия код
#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(PLUGIN, VERSION, AUTHOR); 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_flags( client ) & ADMIN_LEVEL_H) ) { ColorPrint( client, "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_additem( hMenu, "Revive Player", "0" ); menu_additem( hMenu, "Revive All", "1" ); menu_additem( hMenu, "Revive Self", "2" ); menu_additem( hMenu, "Revive \rCT", "3" ); menu_additem( hMenu, "Revive \rTerrorist", "4" ); if(get_user_flags(client) && ADMIN_IMMUNITY) menu_additem( hMenu, "Auto \rRevive \wMenu", "5" ); menu_display( client, hMenu, 0 ); return PLUGIN_HANDLED; } public CMDMenu_Handler( id, hMenu, iItem ) { if( iItem == MENU_EXIT ) { menu_destroy( hMenu ); return PLUGIN_HANDLED; } new szData[ 6 ]; new iAccess, hCallback; menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, _, _, hCallback ); switch( str_to_num( szData ) ) { case 0: { CmdRV( id ) } case 1: { client_cmd(id,"hex_revive ^"@CT^" ^"100^" ^"0^""); client_cmd(id,"hex_revive ^"@T^" ^"100^" ^"0^""); ColorPrint(0 , "^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(0 , "^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(0 , "^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_destroy( hMenu ); 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(id, KEYSMENU, menu, -1, "Auto Revive Menu") } } public admin_menu(id, key, menu) { 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 CmdRV( client ) { if ( !(get_user_flags( client ) & ADMIN_LEVEL_H) ) { ColorPrint( client, " You have no access to this command." ); return PLUGIN_HANDLED; } static szItem[ 128 ], Menu, Players[ 32 ], iNum, szTempid[ 10 ]; formatex( szItem, charsmax( szItem ), "\rRevive Player Menu"); Menu = menu_create( szItem, "SubRV" ); get_players( Players, iNum) for ( new i; i < iNum; i++ ) { new iPlayer = Players[ i ]; if( !is_user_connected(iPlayer) || is_user_bot(iPlayer) || is_user_alive(iPlayer) || cs_get_user_team(iPlayer) == CS_TEAM_SPECTATOR) continue; num_to_str( iPlayer, szTempid, charsmax( szTempid ) ); formatex( szItem, charsmax( szItem ), "%s", szName( iPlayer )); menu_additem( Menu, szItem, szTempid ); } menu_display( client, Menu ); return 1; } public SubRV( client, Menu, Item ) { if ( Item == MENU_EXIT ) { menu_destroy( Menu ); return 1; } new Access, Callback, Name[ 64 ], Data[ 6 ]; menu_item_getinfo( Menu, Item, Access, Data, charsmax( Data ), Name, charsmax( Name ),Callback ); new iPlayer = str_to_num( Data ); ColorPrint(0 , "^4^3[ADMIN : ^4%s^3]^1 Gave Revive To ^4[%s]^1",szName( client ),szName( iPlayer )); Revive(iPlayer,100,0); menu_destroy( Menu ); CmdRV( client ); 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(i = 0;i < 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_CreateNamedEntity, engfunc(EngFunc_AllocString, item)); if(!pev_valid(ent)) return; static Float:originF[3] pev(id, pev_origin, originF); set_pev(ent, pev_origin, originF); set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN); dllfunc(DLLFunc_Spawn, ent); static save save = pev(ent, pev_solid); dllfunc(DLLFunc_Touch, ent, id); if(pev(ent,pev_solid) != save) return; engfunc(EngFunc_RemoveEntity, ent); } 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 szMsg[ 191 ], Players[ 32 ], PNum = 1; static Len; Len = formatex( szMsg, charsmax( szMsg ), ""); vformat( szMsg[ Len ], charsmax ( szMsg ) - Len, szString, 3 ); if ( client ) Players[ 0 ] = client; else get_players( Players, PNum, "ch" ); for ( new i; i < PNum; i++ ) { if ( is_user_connected( Players[ i ] ) ) { message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ) ,_, Players[ i ] ); write_byte( Players[ i ] ); write_string( szMsg ); message_end( ); } } return 1; } stock szName( const index ) { static g_szName[ 32 ]; get_user_name( index, g_szName, charsmax( g_szName ) ); return g_szName; } stock fm_get_user_team( const index ) return get_pdata_int( index, 114 );
-
- Подобни теми
- Отговори
- Преглеждания
- Последно мнение
-
- 4 Отговори
- 1891 Преглеждания
-
Последно мнение от atmax
-
- 2 Отговори
- 1191 Преглеждания
-
Последно мнение от thoughtz
-
- 1 Отговори
- 644 Преглеждания
-
Последно мнение от tom1k
-
- 0 Отговори
- 830 Преглеждания
-
Последно мнение от tom1k
-
- 0 Отговори
- 780 Преглеждания
-
Последно мнение от TeOX993
-
- 0 Отговори
- 1598 Преглеждания
-
Последно мнение от Just
-
- 1 Отговори
- 613 Преглеждания
-
Последно мнение от pok4
Кой е на линия
Потребители разглеждащи този форум: Google [Bot], Semrush [Bot] и 11 госта