Raised This Month: $ Target: $400
 0% 

Origin & Aimvecs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 10-28-2006 , 05:20   Origin & Aimvecs
Reply With Quote #1

Why wont this make a laserbeam, between the two clients..?

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "New Plugin" #define VERSION "1.0" #define AUTHOR "Author" new laser public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("Damage","do_laser","a") } public plugin_precache() {     laser = precache_model("sprites/laserbeam.spr") } public do_laser() {         new id = read_data(1)     new kid = read_data(2)     new origin[32][3]     get_user_origin(id, origin[id],1)     get_user_origin(kid, origin[kid],1)             message_begin(MSG_BROADCAST,SVC_TEMPENTITY) // I get a warning at this line saying, loose identation.     write_byte (TE_BEAMPOINTS)     write_coord(origin[id][0])     write_coord(origin[id][1])     write_coord(origin[id][2])     write_coord(origin[kid][0])     write_coord(origin[kid][1])     write_coord(origin[kid][2])     write_short(laser);     write_byte(1) // framestart     write_byte(5) // framerate     write_byte(2) // life     write_byte(5) // width     write_byte(1) // 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()     }
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 10-28-2006 , 05:50   Re: Origin & Aimvecs
Reply With Quote #2

coz
1) Damage is not a global event
2) theres no attacker id passed

Code:
register_event("Damage","do_laser","be") ... public do_laser(id) {     new kid = get_user_attacker(id)     new orig1[3], orig2[3]     get_user_origin(id, orig1,1)     get_user_origin(kid, orig2,1)     //tempentity event.. }

.. or u were supposed to use DeathMsg but somehow messed em up
__________________
plop
p3tsin is offline
schnitzelmaker
Senior Member
Join Date: Apr 2006
Location: HERE
Old 10-28-2006 , 06:00   Re: Origin & Aimvecs
Reply With Quote #3

Quote:
2) theres no attacker id passed
Not fully right,you can get the id with
Code:
new victim = read_data(0)
__________________
schnitzelmaker is offline
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 10-28-2006 , 13:28   Re: Origin & Aimvecs
Reply With Quote #4

Quote:
Originally Posted by schnitzelmaker View Post
Not fully right,you can get the id with
Code:
new victim = read_data(0)
umm, what?
__________________
plop
p3tsin is offline
schnitzelmaker
Senior Member
Join Date: Apr 2006
Location: HERE
Old 10-28-2006 , 17:48   Re: Origin & Aimvecs
Reply With Quote #5

On some events you can read the data.
As example on the damage event are there:
Code:
new damage = read_data(2);//the damage who the player get. new victim = read_data(0);//the playerid who get the damage.
And you get the attackerid with:
Code:
new attacker = get_user_attacker(victim,weapon,hitplace);
There are some more data but i dont know all.
__________________

Last edited by schnitzelmaker; 10-28-2006 at 17:50.
schnitzelmaker is offline
Reply


Thread Tools
Display Modes

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:51.


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