Here you go. untested but should work fine.
This hooks all weapons to shot a laser sprite.
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "Shot laser"
#define VERSION "1.0"
#define AUTHOR "ironskillz1"
new g_iLasersprite;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
new szWeaponName[32]
new NOSHOT_BITSUM = (1<<CSW_KNIFE) | (1<<CSW_HEGRENADE) | (1<<CSW_FLASHBANG) | (1<<CSW_SMOKEGRENADE)
for(new iId = CSW_P228; iId <= CSW_P90; iId++)
{
if( ~NOSHOT_BITSUM & 1<<iId && get_weaponname(iId, szWeaponName, charsmax(szWeaponName)) )
{
RegisterHam(Ham_Weapon_PrimaryAttack, szWeaponName, "Ham_ShootLaser")
}
}
}
public plugin_precache()
g_iLasersprite = precache_model("sprites/white.spr");
public Ham_ShootLaser(entity)
{
if(pev_valid(entity))
{
static iWeapon, id, iClip, iAmmo;
iWeapon = get_pdata_int(entity, 43, 4);
id = get_pdata_cbase(entity, 41, 4);
get_user_ammo(id, iWeapon, iClip, iAmmo);
if(!is_user_alive(id) || iAmmo == 0 )
return HAM_HANDLED;
Player_ShootLaser(id);
}
return HAM_HANDLED;
}
stock Player_ShootLaser(id)
{
new szOrigin[3];
get_user_origin(id, szOrigin, 3);
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(TE_BEAMENTPOINT);
write_short(id | 0x1000);
write_coord(szOrigin[0]);
write_coord(szOrigin[1]);
write_coord(szOrigin[2]);
write_short(g_iLasersprite);
write_byte(0);
write_byte(10);
write_byte(1);
write_byte(5);
write_byte(0);
//colors
write_byte(50);
write_byte(50);
write_byte(50);
write_byte(255);
write_byte(10);
message_end();
}
__________________