Announce Spray Height above the floor in Chat (vector tracing problem)
Hello nice people,
I'm currently setting up a jail server [CS:S] for some people and we need one plugin to work for our spray contests. Sadly I couldn't find such plugin, any spraytracer I found doesn't offer this function. The plugin should announce the spray height relative to the floor directly while/after the spray is placed on a wall in text chat. (cool would be announce of "touches the ground/ceiling" too) Well, I found one plugin doing this but it is for amxx. I tried to find equivalents to each function in the API database but no success, maybe someone can give me a hint how I could translate this to sourcepawn? Here is the code of the amx plugin mentioned above: Code:
#include < amxmodx > |
Re: Announce Spray Height in Chat [converting a simple amx plugin to sourcepawn]
Hello again, here you can see my progress.
As you may notice the third debug message doesn't output anything, I guess it is because I fucked up the second vector trace OR the second vector trace fails instantly because the 'aim location' is in a wall (is there a possibility to filter only floor/ceiling and no walls?) I really appreciate any help with this, thank you very much in advance. Code:
#include <sdktools> Code:
SourcePawn Compiler 1.7.1 Code:
player position x: -938.6, y: -1567.9, z: 128.0 |
Re: Announce Spray Height above the floor in Chat (vector tracing problem)
Got it running now. However if you're standing directly in front of a wall it doesnt work as expected, maybe one of you guys knows a solution for this?
If someone cares about the working plugin look at this Code:
#include <sdktools> |
Re: Announce Spray Height above the floor in Chat (vector tracing problem)
Quote:
|
Re: Announce Spray Height in Chat [converting a simple amx plugin to sourcepawn]
Quote:
|
Re: Announce Spray Height in Chat [converting a simple amx plugin to sourcepawn]
Thank you for the replies, let me answer them:
Quote:
Quote:
Right now I just take the z coord of the aim vector and the z coord of the ground vector (where x,y is the same) and substract them to get the height relative to the floor. The plugin however seems to get the wrong height for the ground vector if you stand against the wall. Aside from that I need to code a third trace to determine if the spray touches the ceiling (ground is easy tho because the height is 0+0,5*spraysize then) If you want to test out my plugin feel free to visit my server at 95.216.17.188:27015 (only this plugin + sm base is running) |
Re: Announce Spray Height above the floor in Chat (vector tracing problem)
When you say you get the wrong height, where is your second vector hitting? It might be useful to use tempent beams to visualize your traces. If it's hitting the same wall you're starting the trace from, you could try moving the start point of your second trace slightly backwards along the line of the first trace, but it'll take a little math on your part.
|
Re: Announce Spray Height above the floor in Chat (vector tracing problem)
Quote:
The idea of moving the origin is fine, maybe I should just take the x,y coords from the player to take the math easy. Edit: Code:
//adding one unit in player direction to prevent the -64 units bug |
Re: Announce Spray Height above the floor in Chat (vector tracing problem)
Some updates:
The plug-in works now, the -64 units bug persists. Also the calculation of unit height isn't linear / dependent on the viewangle. So my next question is: is there another option to get the spray position apart from tracing the aim vector? |
Re: Announce Spray Height above the floor in Chat (vector tracing problem)
|
All times are GMT -4. The time now is 06:45. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.