Raised This Month: $51 Target: $400
 12% 

Help please


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Saint Sinner
Senior Member
Join Date: Feb 2016
Old 01-18-2018 , 19:23   Help please
Reply With Quote #1

Why this plugin no detect gang-bang? It doesn't work. Something is missing i think


Code:
#include <amxmodx>
#include <fun>
#include <fakemeta>
#include <cstrike>
 
#define PLUGIN  "Anti-Gangbang" 
#define VERSION "1.0" 
#define AUTHOR  "pRED* + Avalanche" 

new bool:bangprotected; 

#define ATTACK_COOLDOWN 2.0

new Float:g_LastAttack[33]
// optimization
new Float:g_Cooldown = ATTACK_COOLDOWN


new cvar_bang_enabled
new cvar_weapon_mode

public plugin_init() 
{     
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_forward(FM_TraceHull,"fm_tracehull",1);
	register_forward(FM_TraceLine,"fw_traceline",1);
	
	cvar_bang_enabled = register_cvar("amx_bang_enabled","1")
	cvar_weapon_mode = register_cvar("amx_bang_weapons","0")
}

public plugin_cfg() 
{     
	new szMapName[64];     
	get_mapname(szMapName, 63);     
	if(containi(szMapName, "ka_") || containi(szMapName, "knife")) 
	{     
		bangprotected = true;     
	} 
} 

public fm_tracehull(Float:start[3],Float:end[3],noMonsters,hull,id,trace)
{
	if(!is_user_connected(id) || !is_user_alive(id))
		return FMRES_IGNORED;

	
	if (!(bangprotected) && !(get_pcvar_num(cvar_bang_enabled)))
		return FMRES_IGNORED;

	new dummy,weapon = get_user_weapon(id,dummy,dummy);
	// not immune to this weapon
	if(weapon!=CSW_KNIFE)
		return FMRES_IGNORED;

	trace_check(id,trace);

	return FMRES_IGNORED;

}

public fw_traceline(Float:start[3],Float:end[3],noMonsters,id,trace)
{
	if(!is_user_connected(id) || !is_user_alive(id))
		return FMRES_IGNORED;

	
	if (!(bangprotected) && !(get_pcvar_num(cvar_bang_enabled)))
		return FMRES_IGNORED;

	if (!(get_pcvar_num(cvar_weapon_mode)))
		return FMRES_IGNORED;
	
	trace_check(id,trace);

	return FMRES_IGNORED;
}
 

public trace_check(id,trace)
{
	new hit = get_tr2(trace,TR_pHit);

	// not a player getting aimed at
	if(!is_user_alive(hit))
		return FMRES_IGNORED;


	new CsTeams:team = cs_get_user_team(id)
	new CsTeams:hitteam = cs_get_user_team(hit)

	if (team==hitteam)
		return FMRES_IGNORED;


	new Origin[3]
	get_user_origin(id, Origin);
	
	//check if there is other people close to hit.
	//if yes then block.
	new enemycount=0
	
	new ent = -1
	while((ent = engfunc(EngFunc_FindEntityInSphere, ent, Origin, 350.0)) != 0)
	{
		if(!pev_valid(ent) || !is_user_alive(ent))
			continue
		
		if (team!=cs_get_user_team(ent))
			continue
		
		enemycount++
		
		if (enemycount>1)
		{
			set_tr2(trace,TR_flFraction,1.0);

			new Float:Time
    			global_get(glb_time,Time)    
    
    			if(Time - g_Cooldown > g_LastAttack[hit])
 			{
				new UserName[33]
				get_user_name(hit, UserName, 32);
				client_print(0, print_chat, "[ANTI-GANGBANG] %s is being gangbanged and now has godmode!", UserName);
				g_LastAttack[hit] = Time
			}


			break	
		}
	}

	return FMRES_IGNORED;

}
Saint Sinner is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 01-19-2018 , 07:23   Re: Help please
Reply With Quote #2

Are you the author of this plugin? Probably not. So next time please use "suggestions/requests" and Use a propper name, like ""gangbang" plugin not working", or "please fix "gangbang" plugin". "HELP ME" and "omg why is this not working" don't cut it.
__________________
retired chump
DjSoftero is offline
Saint Sinner
Senior Member
Join Date: Feb 2016
Old 01-19-2018 , 10:32   Re: Help please
Reply With Quote #3

Quote:
Originally Posted by DjSoftero View Post
Are you the author of this plugin? Probably not. So next time please use "suggestions/requests" and Use a propper name, like ""gangbang" plugin not working", or "please fix "gangbang" plugin". "HELP ME" and "omg why is this not working" don't cut it.

Are you drinking? can be seen who is author .. not everyone thinks like you and just STFU! Mr. Veteran Member )

Where whrite if i delete the post is forbidden?

https://forums.alliedmods.net/search...rchid=17297286

Last edited by Saint Sinner; 01-19-2018 at 10:34.
Saint Sinner is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 01-20-2018 , 03:11   Re: Help please
Reply With Quote #4

it`s not that you`re not the author. you're asking us to fix the plugin for you in the wrong section.

and what is a "gangbang" anyways
__________________
retired chump

Last edited by DjSoftero; 01-20-2018 at 03:12.
DjSoftero is offline
Saint Sinner
Senior Member
Join Date: Feb 2016
Old 01-20-2018 , 05:06   Re: Help please
Reply With Quote #5

If is one tero and two, three CT in this ( Origin 350.0 ) this plugin will get the players godmode
if is one tero and one ct in this ( Origin 350.0 ) nothing happens..
This is a anti gangbang 1v2, 1v3, 1v4 ...... I apologize becouse i posted here!

Last edited by Saint Sinner; 01-20-2018 at 05:08.
Saint Sinner is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 01-20-2018 , 05:37   Re: Help please
Reply With Quote #6

so if more than one ct is around a terrorist, then the terrorist guy gets godmode?
__________________
retired chump
DjSoftero is offline
Saint Sinner
Senior Member
Join Date: Feb 2016
Old 01-20-2018 , 05:49   Re: Help please
Reply With Quote #7

Yes ! and if more than one t is around a ct , then the ct guy gets godmode
Saint Sinner is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 01-20-2018 , 15:58   Re: Help please
Reply With Quote #8

maybe this:
PHP Code:
if (team!=cs_get_user_team(ent))
            continue 
to this:
PHP Code:
if (team==cs_get_user_team(ent))
            continue 
__________________
retired chump
DjSoftero 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 02:30.


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