AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to draw a colored line from one point to another? (https://forums.alliedmods.net/showthread.php?t=85929)

ExboCooope 02-18-2009 05:06

How to draw a colored line from one point to another?
 
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)

Arkshine 02-18-2009 05:11

Re: How to draw a colored line from one point to another?
 
Use TE_BEAMPOINTS message. See message_const.inc.

anakin_cstrike 02-18-2009 08:27

Re: How to draw a colored line from one point to another?
 
Here's an example using that
http://forums.alliedmods.net/showthread.php?t=85111

Bugsy 02-18-2009 08:30

Re: How to draw a colored line from one point to another?
 
Quote:

Originally Posted by ExboCooope (Post 763706)
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() }

anakin_cstrike 02-18-2009 13:12

Re: How to draw a colored line from one point to another?
 
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:mrgreen:

ExboCooope 02-19-2009 09:59

Re: How to draw a colored line from one point to another?
 
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.

anakin_cstrike 02-19-2009 10:01

Re: How to draw a colored line from one point to another?
 
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() }

Arkshine 02-19-2009 10:30

Re: How to draw a colored line from one point to another?
 
On a side note, using MSG_BROADCAST would not be too bad.


All times are GMT -4. The time now is 17:05.

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