AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Trigger when passing origin (https://forums.alliedmods.net/showthread.php?t=46543)

stigma 10-28-2006 16:55

Trigger when passing origin
 
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?

schnitzelmaker 10-28-2006 17:39

Re: Trigger when passing origin
 
This is from me_mines:http://www.nsmod.org/forums/index.php?showtopic=1937
Code:
 new hit = trace_line(ent,fstart,ftarget,target)       if(hit > 0){         if(pev(hit,pev_team) != 0){
You need a set_task/think,... and make a trace line inside,this return a valid playerid if someone touch this laserline.

stigma 10-28-2006 18:48

Re: Trigger when passing origin
 
well i've found out...

Just used client_PreThink and get_user_aiming


All times are GMT -4. The time now is 04:55.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.