//Grabs onto someone
public set_grabbed( id, target )
{
if(!(get_user_flags(id) & ADMIN_LEVEL_E))return 1;
if( get_pcvar_num( p_glow ) )
{
new Float:color[3]
color[0] = float(color1[id]);
color[1] = float(color2[id]);
color[2] = float(color3[id]);
set_pev( target, pev_renderfx, kRenderFxGlowShell )
set_pev( target, pev_rendercolor, color )
set_pev( target, pev_rendermode, kRenderTransColor )
set_pev( target, pev_renderamt, a )
}
if( 0 < target <= MAXPLAYERS )
client_data[target][GRABBER] = id
client_data[id][FLAGS] = 0
client_data[id][GRABBED] = target
new name[33], name2[33]
get_user_name(id, name, 32)
get_user_name(target, name2, 32)
if(get_user_team(target)==1 || get_user_team(target)==2 || get_user_team(target)==3)
{
client_cmd(target, "spk MG_grab/grab_victim_xa.wav")
client_cmd(id, "spk MG_grab/grab_mine1.wav")
ChatColor(target, "%s !yАдминистратор !team%s !yвзял вас !gграбом", JB_PREFIX, name)
ChatColor(id, "%s !yВы взяли !gГрабом !yигрока !team%s", JB_PREFIX, name2)
grab_eff(target)
#if defined GRAB_MENU
grab_menu(id)
#endif
}
else
{
//ChatColor(id, "%L", id, "CHAT_3")
ChatColor(id, "%s !yВы взяли !gГрабом !teamОружие", JB_PREFIX)
ChatColor(0, "%s !yАдминистратор !team%s !yвзял !gграбом !teamОружие", JB_PREFIX, name)
client_cmd(0, "spk MG_grab/grab_weapon.wav")
}
new Float:torig[3], Float:orig[3]
pev( target, pev_origin, torig )
pev( id, pev_origin, orig )
client_data[id][GRAB_LEN] = floatround( get_distance_f( torig, orig ) )
if( client_data[id][GRAB_LEN] < get_pcvar_num( p_min_dist ) ) client_data[id][GRAB_LEN] = get_pcvar_num( p_min_dist )
return 1;
}