AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Touch Kill (https://forums.alliedmods.net/showthread.php?t=250016)

Snitch 10-16-2014 16:31

Touch Kill
 
im terorist and i can kill the CT, but he not me

i want ct can kill t, and t kill ct
Code:

public Ham_Touch_Grenade_Pre( iEntity, id )
{
          if( g_iCurrentGame == GAME_ANGRYBIRDS )
{
          static i_owner
          i_owner = pev(iEntity, pev_owner)
          if(is_user_alive(id) && cs_get_user_team(i_owner) == CS_TEAM_T && cs_get_user_team(id) == CS_TEAM_CT)
          {
          ExecuteHamB(Ham_Killed, id, i_owner, 0)
          }
          else remove_entity(iEntity)
}
}


wickedd 10-16-2014 17:10

Re: Touch Kill
 
Just remove the team check.

hleV 10-17-2014 06:31

Re: Touch Kill
 
PHP Code:

new FriendlyFireCvar;

public 
plugin_init()
{
    
FriendlyFireCvar get_cvar_pointer("mp_friendlyfire");
}

public 
Ham_Touch_Grenade_PreiEntityid )
{
          if( 
g_iCurrentGame == GAME_ANGRYBIRDS )
{
          static 
i_owner
          i_owner 
pev(iEntitypev_owner)
          if(
is_user_alive(id) && (get_pcvar_num(FriendlyFireCvar) || (cs_get_user_team(i_owner) != cs_get_user_team(id))))
          {
          
ExecuteHamB(Ham_Killedidi_owner0)
          }
          else 
remove_entity(iEntity)
}



Natsheh 10-17-2014 06:43

Re: Touch Kill
 
Quote:

Originally Posted by hleV (Post 2212060)
PHP Code:


FriendlyFireCvar 
get_cvar_pointer("mp_friendyfire"); 


>>
Code:

FriendlyFireCvar = get_cvar_pointer("mp_friendlyfire");



All times are GMT -4. The time now is 17:43.

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