Code:
#include <amxmodx>
#include <engine>
new beam
public plugin_init() {
register_plugin("Nothing","0.1","idkfa")
}
public plugin_precache() {
beam = precache_model("sprites/laserbeam.spr")
}
public client_PreThink(id) {
new aimID
new aimBody
get_user_aiming(id,aimID,aimBody)
if (aimID && get_user_team(aimID) != get_user_team(id)) {
hook_beam(id,aimID)
}
}
public hook_beam(id, aimID) {
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(8) //TE_BEAMENTS
write_short(id)
write_short(aimID)
write_short(beam)
write_byte(0)
write_byte(1)
write_byte(0)
write_byte(25)
write_byte(10)
write_byte(100)
write_byte(100)
write_byte(255)
write_byte(127)
write_byte(0)
message_end()
}
How come that it makes a laserbeam just as i spawn, and the beam isent "attached" to a player.. I just attached to the air..
See the attached pic..