Files
IL-GSC/BO1/PC/ZM/clientscripts/_flamethrower_plight.csc
2024-02-18 17:32:07 -05:00

31 lines
1.1 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

init()
{
level._effect["ft_pilot_light"] = LoadFX( "weapon/muzzleflashes/fx_pilot_light" );
}
play_pilot_light_fx( localClientNum )
{
self notify( "new_pilot_light" );
self endon( "new_pilot_light" );
self endon( "entityshutdown" );
if( !IsDefined(level._ft_pilot_on) || !IsDefined( level._ft_pilot_on[ localClientNum ] ) )
{
level._ft_pilot_on[ localClientNum ] = false;
}
while ( true )
{
new_weapon = GetCurrentWeapon( localClientNum );
if( GetSubStr( new_weapon, 0, 3 ) == "ft_" && !level._ft_pilot_on[ localClientNum ] )
{
AssertEx(IsDefined(level._effect["ft_pilot_light"]), "Need to call 'clientscripts\_flamethrower_plight::init();' in you client script.");
level._ft_pilot_light = PlayViewmodelFx( localClientNum, level._effect["ft_pilot_light"], "tag_flamer_pilot_light" );
level._ft_pilot_on[ localClientNum ] = true;
}
else if( GetSubStr( new_weapon, 0, 3 ) != "ft_" && level._ft_pilot_on[ localClientNum ] )
{
DeleteFX( localClientNum, level._ft_pilot_light );
level._ft_pilot_on[ localClientNum ] = false;
}
wait 0.5;
}
}