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

API Scripting Help [HELP]Replace old tracers with connor's tracers


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 03-09-2015 , 12:29   [HELP]Replace old tracers with connor's tracers
Reply With Quote #1

how can i replace the tracers from the second post with the tracers created by connor?
also a method to set the tracer color

Code:
public TraceAttack(iEnt, iAttacker, Float:flDamage, Float:fDir[3], ptr, iDamageType)
{
	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
}
Code:
public make_tracer(id)
{
	if (get_pcvar_num(cvar_goldbullets))
	{
		new clip,ammo
		new wpnid = get_user_weapon(id,clip,ammo)
		new pteam[16]
		
		get_user_team(id, pteam, 15)
		
		if ((bullets[id] > clip) && (wpnid == CSW_M4A1) && g_haswep[id]) 
		{
			new vec1[3], vec2[3]
			get_user_origin(id, vec1, 1) // origin; your camera point.
			get_user_origin(id, vec2, 4) // termina; where your bullet goes (4 is cs-only)
			
			
			//BEAMENTPOINTS
			message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
			write_byte (0)     //TE_BEAMENTPOINTS 0
			write_coord(vec1[0])
			write_coord(vec1[1])
			write_coord(vec1[2])
			write_coord(vec2[0])
			write_coord(vec2[1])
			write_coord(vec2[2])
			write_short( m_spriteTexture )
			write_byte(1) // framestart
			write_byte(5) // framerate
			write_byte(2) // life
			write_byte(10) // width
			write_byte(0) // noise
			write_byte( 255 )     // r, g, b
			write_byte( 255 )       // r, g, b
			write_byte( 255 )       // r, g, b
			write_byte(200) // brightness
			write_byte(175) // speed
			message_end()
		}
	
		bullets[id] = clip
	}
	
}
Depresie is offline
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 03-09-2015 , 13:11   Re: [HELP]Replace old tracers with connor's tracers
Reply With Quote #2

Simply use the code from the 1st post, remember to RegisterHam for it(You can find example in a lot of plugins, commonly extra weapons).
Also, TE_TRACER does not allowed color changing, so you must use TE_USERTRACER. See message_const.inc to know its usage.
__________________
Currently offline for study.
RateX 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 04:26.


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