someone asked me for this
PHP:
/* MOD.Weapon.core */
stock MOD_Weapon_PreCache () {}
public @WeaponBeam ( Client, Weapon, const Class[], Size )
{
register_message( get_user_msgid("KillTrail"), "@KillTrail" );// We had better register in 'PluginInit' tho
set_task( 0.5, "@BeamDetach", Weapon );// Set detachment time
}
public @BeamDetach( Weapon )
{
set_pdata_int( pev( Weapon, pev_owner ), 202, false );// bool: AttackShooting
/* Detach the Beam */
message_begin( MSG_ALL, get_user_msgid( "DetachTrail" ) );
write_long( Weapon );
message_end( );
setWeaponHOMING( Weapon, 550.0, 1, 1 | 2);// Set weapon speed and trackable
}
public @KillTrail( MsgID, dest )
{
new Weapon = get_msg_arg_int( 1 );
remove_task( Weapon );
}