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

Advanced Weapon Tracers 1.3.0 (21 jun 2008)


Post New Thread Reply   
 
Thread Tools Display Modes
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 09-02-2014 , 19:54   Re: Advanced Weapon Tracers 1.3.0 (21 jun 2008)
Reply With Quote #111

Syturi0 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 09-02-2014 , 20:57   Re: Advanced Weapon Tracers 1.3.0 (21 jun 2008)
Reply With Quote #112

Since there's nothing wrong with the plugin, post in the request section. When you post, make sure you attach the .sma. The one that you edited so we can help you fix the errors.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 09-02-2014 , 21:03   Re: Advanced Weapon Tracers 1.3.0 (21 jun 2008)
Reply With Quote #113

I dindt edit anything, this is the .sma file from the post
Syturi0 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 09-02-2014 , 21:03   Re: Advanced Weapon Tracers 1.3.0 (21 jun 2008)
Reply With Quote #114

@ Syturio, please update your AMXX version to the latest version.

Last edited by zmd94; 09-02-2014 at 21:04.
zmd94 is offline
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 09-02-2014 , 21:08   Re: Advanced Weapon Tracers 1.3.0 (21 jun 2008)
Reply With Quote #115

Quote:
Originally Posted by zmd94 View Post
@ Syturio, please update your AMXX version to the latest version.
Its Syturi0.
You mean my Compiler?
Syturi0 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 09-02-2014 , 21:15   Re: Advanced Weapon Tracers 1.3.0 (21 jun 2008)
Reply With Quote #116

Quote:
You mean my compiler?
Yes, which version that you use? I'm using AMXX 1.8.2 and the code can be compiled perfectly. ;)
zmd94 is offline
ExAnimo
Junior Member
Join Date: Nov 2010
Location: Russia
Old 05-18-2018 , 01:57   Re: Advanced Weapon Tracers 1.3.0 (21 jun 2008)
Reply With Quote #117

please can somebody add random percentage chance successful tracer , 10% will be enough
on both plugins weapon_laser_tracers and advanced_weapon_tracers

here example in Ricochet plugin

https://forums.alliedmods.net/showth...=101383&page=6
ExAnimo is offline
ExAnimo
Junior Member
Join Date: Nov 2010
Location: Russia
Old 12-17-2020 , 19:13   Re: Advanced Weapon Tracers 1.3.0 (21 jun 2008)
Reply With Quote #118

hi, please help. I make this code , is will be correct for 10 percent chance for trace ? If trace_chance = 1
How make for sniper rifles 50% and for other weapons 10% ?
Code:
/*	Formatright © 2009, ConnorMcLeod

	TraceAttack is free software;
	you can redistribute it and/or modify it under the terms of the
	GNU General Public License as published by the Free Software Foundation.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with TraceAttack; if not, write to the
	Free Software Foundation, Inc., 59 Temple Place - Suite 330,
	Boston, MA 02111-1307, USA.
*/

/************** CUSTOMIZATION AREA ***************/

#define TMP_IS_A_SILENCED_WEAPON
//#define PER_PLAYER_SETTINGS

/*********** END OF CUSTOMIZATION AREA ***********/

#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

#define VERSION "1.3.0"

#define MAX_PLAYERS	32
#define IsPlayer(%1)	( 1 <= %1 <= g_iMaxPlayers )
#define write_coord_f(%1)	engfunc(EngFunc_WriteCoord,%1) 

#define m_pActiveItem	373

const GUNS_BITSUM  = ((1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE))
const SHOTGUNS_BITSUM = ((1<<CSW_XM1014)|(1<<CSW_M3))
const SMGS_BITSUM  = ((1<<CSW_MAC10)|(1<<CSW_UMP45)|(1<<CSW_MP5NAVY)|(1<<CSW_TMP)|(1<<CSW_P90))
const RIFFLES_BITSUM  = ((1<<CSW_AUG)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_M249)|(1<<CSW_M4A1)|(1<<CSW_SG552)|(1<<CSW_AK47))
const SNIPERS_BITSUM  = ((1<<CSW_SCOUT)|(1<<CSW_SG550)|(1<<CSW_AWP)|(1<<CSW_G3SG1))

const SILEN_BITSUM	= ((1<<CSW_USP)|(1<<CSW_M4A1))

enum _:PcvarsNum {
	HandGuns = 0,
	ShotGuns,
	SmgGuns,
	RiffleGuns,
	SnipeGuns
}

new const g_iWeaponBitSumList[] = { GUNS_BITSUM , SHOTGUNS_BITSUM , SMGS_BITSUM , RIFFLES_BITSUM , SNIPERS_BITSUM }

new pcv_chance

new g_iMaxPlayers
new Trie:g_tClassNames

new g_pCvar[PcvarsNum], g_pCvarTraceEnabled, g_pCvarTraceHideSilen

#if defined PER_PLAYER_SETTINGS
new g_bHltv[MAX_PLAYERS+1], g_bSeeTracers[MAX_PLAYERS+1]
new g_pCvarTraceHltv
#endif

public plugin_precache()
{
	g_tClassNames = TrieCreate()

	RegisterHam(Ham_TraceAttack, "worldspawn", "TraceAttack", 1)
	TrieSetCell(g_tClassNames, "worldspawn", 1)
	RegisterHam(Ham_TraceAttack, "player", "TraceAttack", 1)
	TrieSetCell(g_tClassNames, "player", 1)

	register_forward(FM_Spawn, "Spawn", 1)
}

public Spawn( iEnt )
{
	if( pev_valid(iEnt) )
	{
		static szClassName[32]
		pev(iEnt, pev_classname, szClassName, charsmax(szClassName))
		if( !TrieKeyExists(g_tClassNames, szClassName) )
		{
			RegisterHam(Ham_TraceAttack, szClassName, "TraceAttack", 1)
			TrieSetCell(g_tClassNames, szClassName, 1)
		}
	}
}

public plugin_end()
{
	TrieDestroy(g_tClassNames)
}

public plugin_init()
{
	register_plugin("Advanced Weapon Tracers", VERSION, "ConnorMcLeod")
	register_cvar("awt_version", VERSION, FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)
    
	g_pCvarTraceEnabled = register_cvar("amx_tracers", "1")
	
    pcv_chance           = register_cvar("trace_chance", "10")
	g_pCvar[HandGuns] = register_cvar("amx_trace_handguns", "1")
	g_pCvar[ShotGuns] = register_cvar("amx_trace_shotguns", "1")
	g_pCvar[SmgGuns] = register_cvar("amx_trace_smgguns", "1")
	g_pCvar[RiffleGuns] = register_cvar("amx_trace_riffleguns", "1")
	g_pCvar[SnipeGuns] = register_cvar("amx_trace_snipeguns", "1")

	g_pCvarTraceHideSilen = register_cvar("amx_trace_hide_silen", "1")

#if defined PER_PLAYER_SETTINGS
	g_pCvarTraceHltv = register_cvar("amx_trace_hltv", "1")
	register_clcmd("say /tracers", "ClientCommand_Tracers")
#endif

	g_iMaxPlayers = get_maxplayers()
}

#if defined PER_PLAYER_SETTINGS
public client_putinserver(id)
{
	g_bSeeTracers[id] = !is_user_bot(id)
	g_bHltv[id] = is_user_hltv(id)
	set_task(35.0, "TaskAnnouncement", id)
}

public ClientCommand_Tracers(id)
{
	client_print(id, print_chat, "** [Advanced Weapon Tracers] Tracers are now %s", 
						(g_bSeeTracers[id] = !g_bSeeTracers[id]) ? "ON" : "OFF")
	return PLUGIN_HANDLED
}

public TaskAnnouncement(id)
{
	client_print(id, print_chat, "** [Advanced Weapon Tracers] You can [en/dis]able tracers by typing /tracers in chat")
}
#endif

public TraceAttack(iEnt, iAttacker, Float:flDamage, Float:fDir[3], ptr, iDamageType)
{
  if (random(10) <= get_pcvar_num(pcv_chance)) {
	if( !IsPlayer(iAttacker) || get_pcvar_num(g_pCvarTraceEnabled) == 0 )
	{
		return
	}

	new iWeapon = get_user_weapon(iAttacker)
	if( iWeapon == CSW_KNIFE )
	{
		return
	}

	new bWeapon = (1<<iWeapon)
	for(new a; a<sizeof(g_iWeaponBitSumList); a++)
	{
		if( bWeapon & g_iWeaponBitSumList[a] )
		{
			if( get_pcvar_num(g_pCvar[a]) )
			{
				break
			}
			else
			{
				return
			}
		}
	}
		
	if( SILEN_BITSUM & bWeapon )
	{
		if( get_pcvar_num(g_pCvarTraceHideSilen) )
		{
			if( cs_get_weapon_silen(get_pdata_cbase(iAttacker, m_pActiveItem)) )
			{
				return
			}
		}
	}
	#if defined TMP_IS_A_SILENCED_WEAPON
	else if( iWeapon == CSW_TMP && get_pcvar_num(g_pCvarTraceHideSilen) )
	{
		return
	}
	#endif

	new iOrigin[3], Float:flEnd[3]

	get_user_origin(iAttacker, iOrigin, 1)
	get_tr2(ptr, TR_vecEndPos, flEnd)

#if defined PER_PLAYER_SETTINGS
	new iPlayers[MAX_PLAYERS], iNum, iPlayer, bHltv
	new x = iOrigin[0], y = iOrigin[1], z = iOrigin[2]
	new Float:fX = flEnd[0], Float:fY = flEnd[1], Float:fZ = flEnd[2]
	get_players(iPlayers, iNum)
	for(new i; i<iNum; i++)
	{
		iPlayer = iPlayers[i]
		if( g_bHltv[iPlayer] )
		{
			if( !bHltv && get_pcvar_num(g_pCvarTraceHltv) == 1 )
			{
				bHltv = true
				message_begin(MSG_SPEC, SVC_TEMPENTITY)
				write_byte(TE_TRACER)
				write_coord(x)
				write_coord(y)
				write_coord(z) 
				write_coord_f(fX) 
				write_coord_f(fY) 
				write_coord_f(fZ) 
				message_end()
			}
		}
		else if( g_bSeeTracers[iPlayer] )
		{
			message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, iPlayer)
			write_byte(TE_TRACER)
			write_coord(x)
			write_coord(y)
			write_coord(z)
			write_coord_f(fX) 
			write_coord_f(fY) 
			write_coord_f(fZ) 
			message_end()
		}
	}
#else
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
	write_byte(TE_TRACER)
	write_coord(iOrigin[0])
	write_coord(iOrigin[1])
	write_coord(iOrigin[2])
	write_coord_f(flEnd[0]) 
	write_coord_f(flEnd[1]) 
	write_coord_f(flEnd[2]) 
	message_end()
#endif
}
}

Last edited by ExAnimo; 12-17-2020 at 19:14.
ExAnimo is offline
ForeskinJohn
Junior Member
Join Date: Apr 2020
Old 02-25-2021 , 09:43   Re: Advanced Weapon Tracers 1.3.0 (21 jun 2008)
Reply With Quote #119

this isnt working, no cvars are autofilling or working either, unless there is a certain way to install im not sure what im doing wrong here..
ForeskinJohn is offline
Reply


Thread Tools
Display Modes

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 05:52.


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