Raised This Month: $ Target: $400
 0% 

Trigger when passing origin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 10-28-2006 , 16:55   Trigger when passing origin
Reply With Quote #1

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?
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
schnitzelmaker
Senior Member
Join Date: Apr 2006
Location: HERE
Old 10-28-2006 , 17:39   Re: Trigger when passing origin
Reply With Quote #2

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.
__________________

Last edited by schnitzelmaker; 10-28-2006 at 17:42.
schnitzelmaker is offline
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 10-28-2006 , 18:48   Re: Trigger when passing origin
Reply With Quote #3

well i've found out...

Just used client_PreThink and get_user_aiming
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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