Raised This Month: $ Target: $400
 0% 

[Solved] Drawing lines


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shaman
Senior Member
Join Date: Dec 2006
Location: Istanbul, Turkey
Old 12-13-2006 , 11:28   [Solved] Drawing lines
Reply With Quote #1

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 )

Last edited by Shaman; 12-15-2006 at 10:15.
Shaman is offline
Send a message via ICQ to Shaman Send a message via AIM to Shaman Send a message via MSN to Shaman Send a message via Yahoo to Shaman
nick123
BANNED
Join Date: Dec 2006
Old 12-13-2006 , 11:55   Re: Drawing lines
Reply With Quote #2

u gotta search more.
nick123 is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 12-13-2006 , 17:23   Re: Drawing lines
Reply With Quote #3

use a te_message (temporary entity).
The Specialist is offline
Send a message via AIM to The Specialist
jim_yang
Veteran Member
Join Date: Aug 2006
Old 12-13-2006 , 22:56   Re: Drawing lines
Reply With Quote #4

check this file message_const.inc in your amxxdir\scripting\include
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 12-14-2006 , 18:56   Re: Drawing lines
Reply With Quote #5

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")
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd
Orangutanz is offline
mateo10
Veteran Member
Join Date: Jan 2006
Old 12-15-2006 , 05:56   Re: Drawing lines
Reply With Quote #6

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?
mateo10 is offline
Shaman
Senior Member
Join Date: Dec 2006
Location: Istanbul, Turkey
Old 12-15-2006 , 10:18   Re: [Solved] Drawing lines
Reply With Quote #7

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 )
Shaman is offline
Send a message via ICQ to Shaman Send a message via AIM to Shaman Send a message via MSN to Shaman Send a message via Yahoo to Shaman
mateo10
Veteran Member
Join Date: Jan 2006
Old 12-15-2006 , 10:49   Re: [Solved] Drawing lines
Reply With Quote #8

How do you do to make it take damage from the player?
mateo10 is offline
Shaman
Senior Member
Join Date: Dec 2006
Location: Istanbul, Turkey
Old 12-15-2006 , 11:14   Re: [Solved] Drawing lines
Reply With Quote #9

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.
Shaman is offline
Send a message via ICQ to Shaman Send a message via AIM to Shaman Send a message via MSN to Shaman Send a message via Yahoo to Shaman
nick123
BANNED
Join Date: Dec 2006
Old 12-15-2006 , 11:33   Re: [Solved] Drawing lines
Reply With Quote #10

radius_damage
nick123 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 06:55.


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