Raised This Month: $ Target: $400
 0% 

How to draw a colored line from one point to another?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ExboCooope
New Member
Join Date: Feb 2009
Old 02-18-2009 , 05:06   How to draw a colored line from one point to another?
Reply With Quote #1

For example:from a[3] to b[3].
It would be better if the line can last for a certan seconds.

I have tried to find it in some Long Jump plugins,but I failed.
(My English is not very well since I am a Chinese)
ExboCooope is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-18-2009 , 05:11   Re: How to draw a colored line from one point to another?
Reply With Quote #2

Use TE_BEAMPOINTS message. See message_const.inc.
Arkshine is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-18-2009 , 08:27   Re: How to draw a colored line from one point to another?
Reply With Quote #3

Here's an example using that
http://forums.alliedmods.net/showthread.php?t=85111
__________________

anakin_cstrike is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-18-2009 , 08:30   Re: How to draw a colored line from one point to another?
Reply With Quote #4

Quote:
Originally Posted by ExboCooope View Post
For example:from a[3] to b[3].
It would be better if the line can last for a certan seconds.

I have tried to find it in some Long Jump plugins,but I failed.
(My English is not very well since I am a Chinese)
Code:
new g_beampoint public plugin_precache() {     g_beampoint = precache_model("sprites/laserbeam.spr") } public draw_laser(Float:start[3], Float:end[3], staytime) {                         message_begin(MSG_ALL, SVC_TEMPENTITY)     write_byte(TE_BEAMPOINTS)     engfunc(EngFunc_WriteCoord, start[0])     engfunc(EngFunc_WriteCoord, start[1])     engfunc(EngFunc_WriteCoord, start[2])     engfunc(EngFunc_WriteCoord, end[0])     engfunc(EngFunc_WriteCoord, end[1])     engfunc(EngFunc_WriteCoord, end[2])     write_short(g_beampoint)     write_byte(0)     write_byte(0)     write_byte(staytime)     write_byte(10)     write_byte(1)     write_byte(255) // Red     write_byte(0) // Green     write_byte(0) // Blue     write_byte(127)     write_byte(1)     message_end() }
__________________
Bugsy is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-18-2009 , 13:12   Re: How to draw a colored line from one point to another?
Reply With Quote #5

Code:
public draw_laser(Float:start[3], Float:end[3], seconds) {                         message_begin(MSG_ALL, SVC_TEMPENTITY)     write_byte(TE_BEAMPOINTS)     engfunc(EngFunc_WriteCoord, start[0])     engfunc(EngFunc_WriteCoord, start[1])     engfunc(EngFunc_WriteCoord, start[2])     engfunc(EngFunc_WriteCoord, end[0])     engfunc(EngFunc_WriteCoord, end[1])     engfunc(EngFunc_WriteCoord, end[2])     write_short(g_beampoint)     write_byte(0)     write_byte(0)     write_byte(seconds*10)     write_byte(10)     write_byte(1)     write_byte(255) // Red     write_byte(0) // Green     write_byte(0) // Blue     write_byte(127)     write_byte(1)     message_end() }
I think he'll like to use seconds not ms, me 2
__________________

anakin_cstrike is offline
ExboCooope
New Member
Join Date: Feb 2009
Old 02-19-2009 , 09:59   Re: How to draw a colored line from one point to another?
Reply With Quote #6

Thank you all,but I think my a[3] and b[3] are "int" not "Float".I wonder how I can transmit them(the origins) into floats.
ExboCooope is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-19-2009 , 10:01   Re: How to draw a colored line from one point to another?
Reply With Quote #7

Code:
public draw_laser(start[3], end[3], seconds) {                         message_begin(MSG_ALL, SVC_TEMPENTITY)     write_byte(TE_BEAMPOINTS)     write_coord( start[ 0 ] )     write_coord( start[ 1 ] )     write_coord( start[ 2 ] )     write_coord( end[ 0 ] )     write_coord( end[ 1 ] )     write_coord( end[ 2 ] )     write_short(g_beampoint)     write_byte(0)     write_byte(0)     write_byte(seconds*10)     write_byte(10)     write_byte(1)     write_byte(255) // Red     write_byte(0) // Green     write_byte(0) // Blue     write_byte(127)     write_byte(1)     message_end() }
__________________

anakin_cstrike is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-19-2009 , 10:30   Re: How to draw a colored line from one point to another?
Reply With Quote #8

On a side note, using MSG_BROADCAST would not be too bad.
Arkshine is offline
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 17:05.


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