AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Friendlyfire Using TakeDamage (https://forums.alliedmods.net/showthread.php?t=190126)

MokeN 07-15-2012 06:35

Friendlyfire Using TakeDamage
 
Hi

Since i'm not so good with hamsandwich, i ask u guys for help.

This is the thing:
I'm making an game menu where i need friendlyfire in Terrorist team under the specific game only and i want to use takedamage, since mp_friendlyfire didn't work.

Request in the TakeDamage:
Terrorist vs Terrorist under a specific "game".

Etc.
PHP Code:

public fwdTakeDamage(iVictimiInflictoriAttackerFloat:flDamageiDmgBits)
{
      if( (
is_user_connected(iAttacker)) && (GAME_WAR <= g_iCurrentGame <= GAME_INTERVENTION <= g_iCurrentGame == GAME_SCOUT) )
      {      
      
AttackerTeam cs_get_user_team(iAttacker);
      
VictimsTeam cs_get_user_team(iVictim);
      
      if(
AttackerTeam == CS_TEAM_T && AttackerTeam == VictimsTeam)
      {
            return 
HAM_SUPERCEDE;
       }
      }
      return 
HAM_IGNORED



Thanks

ConnorMcLeod 07-15-2012 06:45

Re: Friendlyfire Using TakeDamage
 
Top of plugin, global vars :

new mp_friendlyfire


plugin_init :

mp_friendlyfire = get_cvar_pointer("mp_friendlyfire")


fwdTakeDamage :

( AttackerTeam == VictimsTeam && get_pcvar_num(mp_friendlyfire) )


Or depending on what you want to do :

( AttackerTeam != VictimsTeam || get_pcvar_num(mp_friendlyfire) )

MokeN 07-15-2012 07:15

Re: Friendlyfire Using TakeDamage
 
Yeah, i'll try with that connor.

Btw, i tried to use ur free for all plugin but the server ended up crashing all the time, bcuz of SZ_GETSPACE: Overflow..


All times are GMT -4. The time now is 15:22.

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