Laser Dot.. how?
How would i make a laser dot that goes on whatever wall your aiming at like the rocket launcher from the original half-life?
I just have to get where the user is aiming and spawn a transperent sprite wherever they aim. I think I'd use aimvec or something but im not sure how. Are there any heroes that have this that I can look at? Is it even possible? I really need to know how to do this. Thanks for your help all. |
Code:
This is the answer you are looking for. |
laser dot:
precache "sprites/laserdot.spr" use the additive sprite 17. get the aim vector. then: Code:
#define TE_SPRITE 17 // additive sprite, plays 1 cycle |
Im kind of having a little trouble with the help you guys gave me, but it did help get me on track some more and i really appreciate it. Thanks.
I found 2 codes (on amxmodx forums) for a laser sight and I dont know which one to use or how to modify them to match what i want. Can someone help me figure out how to do this. Here's the first example i found: Code:
Code:
And here's the 2nd one (using same precache as above): Code:
So i guess they both do the same thing and they're just a tad bit different. Here's the code im thinking of using (written by myself): Code:
would that work? would that make a laser sight for all players that have the hero and have it follow there cursor no matter what? Thanks for your help all. |
edit: nvm, that looks like it should work, why dont you test it yourself?
|
i dont have cs on this computer.
my main computer got messed up and i have to repair windows. I changed the code around a tiny bit and made the error checking better: Code:
Does my code remove the laser dot when they die or do I have to add that in? I'm not sure how I would do that. So do you guys see any errors... do you think it will work the way i want it to? thanks for all your help guys |
If the user dies, the whole laser thing doesn't get executed at all because you made the check is_user_alive(id). So it's good so far.
|
Quote:
|
if(!shModActive()) return
for( new id = 1; id <= SH_MAXSLOTS; id++ ){ if(!gHasHeroPower[id]) return if(is_user_alive(id)) you can just do somethign like this and make it look way cleaner: Code:
and yes, thats all the code you'll need for laser dot to loop. |
yang, wouldnt that make it so it does the loop if sh is off, they dont have the power, or theyre dead?
shouldnt it be like Code:
for( new id = 1; id <= SH_MAXSLOTS; id++ ){ |
All times are GMT -4. The time now is 23:11. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.