here it is , it worked for about 5 mins then made the server and then never worked
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <cstrike>
#include <fakemeta>
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"
new g_spriteLightning
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
}
public plugin_precache()
{
g_spriteLightning = precache_model("sprites/lgtning.spr")
}
public client_PreThink(id)
{
new targetid, body
get_user_aiming(id, targetid, body)
if(get_user_button(id) & IN_ATTACK2)
{
if (is_user_alive(targetid) && cs_get_user_team(id) != cs_get_user_team(targetid))
{
client_print(0, print_chat, "VALID TARGET")
TakeHp(id, targetid)
}
}
return PLUGIN_HANDLED
}
public TakeHp(id, targetid)
{
new AttackerHp
pev(id, pev_health, AttackerHp)
new VictimHp
pev(targetid, pev_health, targetid)
AttackerHp += 20.0
VictimHp -= 20.0
set_pev(id, pev_health, AttackerHp)
set_pev(targetid, pev_health, VictimHp)
CreateBeam(id, targetid)
}
public CreateBeam(id, targetid)
{
message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
write_byte(8) // TE_BEAMENTS
write_short(targetid) // start entity
write_short(id) // entity
write_short(g_spriteLightning) // model
write_byte(0) // starting frame
write_byte(15) // frame rate
write_byte(1) // life
write_byte(80) // line width
write_byte(10) // noise amplitude
write_byte(255) // r, g, b
write_byte(00) // r, g, b
write_byte(0) // r, g, b
write_byte(35) // brightness
write_byte(5) // scroll speed
message_end()
}