If i have this code:
Code:
new laser
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("checkP","do_laser")
}
public plugin_precache() {
laser = precache_model("sprites/laserbeam.spr")
}
public do_laser(id) {
new orig[3], aimv[3]
get_user_origin(id,orig,1)
get_user_origin(id,aimv,3)
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte (0)
write_coord(orig[0])
write_coord(orig[1])
write_coord(orig[2])
write_coord(aimv[0])
write_coord(aimv[1])
write_coord(aimv[2])
write_short(laser);
write_byte(1) // framestart
write_byte(1) // framerate
write_byte(0) // life
write_byte(50) // width
write_byte(5) // noise
write_byte(100) // r, g, b (red)
write_byte(100) // r, g, b (green)
write_byte(255) // r, g, b (blue)
write_byte(127) // brightness
write_byte(1) // speed
message_end()
}
How could i then get the do_laser function to trigger when my crosshair passes the origin?