AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Solved] Drawing lines (https://forums.alliedmods.net/showthread.php?t=48512)

Shaman 12-13-2006 11:28

[Solved] Drawing lines
 
How can I draw lines like in this picture:
[IMG]http://img139.**************/img139/7991/imagesrc6.jpg[/IMG]
(I searched forum and documentation but I couldn't find anything :cry:)

nick123 12-13-2006 11:55

Re: Drawing lines
 
u gotta search more.

The Specialist 12-13-2006 17:23

Re: Drawing lines
 
use a te_message (temporary entity).

jim_yang 12-13-2006 22:56

Re: Drawing lines
 
check this file message_const.inc in your amxxdir\scripting\include

Orangutanz 12-14-2006 18:56

Re: Drawing lines
 
Code:
UTIL_DrawBeam(start[3], end[3], life, width, noise, red, green, blue, brightness, speed) {     message_begin(MSG_BROADCAST, 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(beam_texture)     write_byte(1) // framestart     write_byte(10) // framerate     write_byte(life) // life in 0.1's     write_byte(width) // width     write_byte(noise) // noise     write_byte(red) // r, g, b     write_byte(green) // r, g, b     write_byte(blue) // r, g, b     write_byte(brightness) // brightness     write_byte(speed) // speed     message_end() }
There you go that'll draw lines for you!

Don't forget to precache this:
beam_texture = precache_model("sprites/lgtning.spr")

mateo10 12-15-2006 05:56

Re: Drawing lines
 
What if you want it to hit an id? I'm making a plugin, The God, which with a command (tg_punish <target> <damage>) shall strike the target with an amount of damage. How shall I do that?

Shaman 12-15-2006 10:18

Re: [Solved] Drawing lines
 
Code:

/* Start Message */
message_begin(MSG_ONE,SVC_TEMPENTITY,{0,0,0},id)
write_byte(TE_BEAMPOINTS)
/* Start Position */
write_coord(origin[0])
write_coord(origin[1])
write_coord(origin[2])
/* End Position */
write_coord(origin2[0])
write_coord(origin2[1])
write_coord(origin2[2])
/* Sprite Index */
write_short(line)
/* Starting Frame */
write_byte(1)
/* Frame Rate in 0.1's. */
write_byte(5)
/* Life in 0.1's */
write_byte(5)
/* Line Width in 0.1's */
write_byte(3)
/* Noise Amplitude in 0.01's */
write_byte(1)
/* Color: Red */
write_byte(255)
/* Color: Green */
write_byte(50)
/* Color: Blue */
write_byte(50)
/* Brightness */
write_byte(155)
/* Scroll Speed in 0.1's */
write_byte(5)
/* End Message */
message_end()

Just change the 'id' in function 'message_begin'. (Learning fast :wink: )

mateo10 12-15-2006 10:49

Re: [Solved] Drawing lines
 
How do you do to make it take damage from the player?

Shaman 12-15-2006 11:14

Re: [Solved] Drawing lines
 
I think it's not possible; but you can do this:
-Check every coordinate beam goes trough,
-If there is a player in one of these coordinates,
-Damage player who beam touched to.

nick123 12-15-2006 11:33

Re: [Solved] Drawing lines
 
radius_damage


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

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