AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   Wallbang Training (https://forums.alliedmods.net/showthread.php?t=144712)

Schwabba 12-07-2010 04:34

Wallbang Training
 
1 Attachment(s)
Wallbang Training v1.0


Desciption:


This plugin shows you where your enemies heads are through the wall.

If you and your Clan try to be one of the professionals, then this plugin is very useful for you. There are already some Wallhack-Maps, those can help you on specific walls, but with this plugin, you can see where your enemies heads are through every wall.

Don't rewrite this plugin that the ability is given to specific players only!


Credits:

KoST - Admin Spectator ESP (idea of a laserbeam to show where enemies are)


CVars:

amx_wallbang 0/1 (Toggle plugin off/on)


Requested:

bende666 requested a similar plugin with the same effect here.


Changelog:

v1.0 - First Release



Exolent[jNr] 12-07-2010 05:22

Re: Wallbang Training
 
Better to use TE_BEAMENTPOINT instead of TE_BEAMPOINTS and use the player id of the player that is looking at the target as the starting entity.

Code:
    write_byte(0)     write_coord(floatround(Origin[0]))     write_coord(floatround(Origin[1]))     write_coord(floatround(Origin[2]))     write_coord(floatround(OriginTarget[0]))     write_coord(floatround(OriginTarget[1]))     write_coord(floatround(OriginTarget[2]))
:arrow:
Code:
    write_byte(TE_BEAMENTPOINT)     write_short(id | 0x1000)     write_coord(floatround(OriginTarget[0]))     write_coord(floatround(OriginTarget[1]))     write_coord(floatround(OriginTarget[2]))

If you don't take this suggestion, at least use the TE_BEAMPOINTS constant instead of 0.

Also, you should use pcvars.

Schwabba 12-07-2010 06:26

Re: Wallbang Training
 
Changed.

I use TE_BEAMPOINTS, because i can set the origin where i want (aimview), TE_BEAMENTPOINT starts at the middle of the body and that's not what i want.

Arkshine 12-07-2010 06:41

Re: Wallbang Training
 
Another suggestion would be :

- Don't create vars into a loop, and I would use static for all the arrays since it's a function called very often.
- write_coord(floatround( : working with float and to avoid to use floatround, use directly : engfunc( EngFunc_WriteCoord,
- Use a swtich for cs_get_user_team
- You use GetBonePosition to get the head position, but I guess it would be fine if you calculate from the player's origin. You have just to add some z value.

Arkshine 12-07-2010 07:36

Re: Wallbang Training
 
Because your plugin is supposed to be used with "normal" player and to get the head position you don't need to use a native. The less native you use the more efficient your plugin will be, more when you use forward called often.

EDIT : You have not probably seen my edit : "Don't create vars into a loop, and I would use static for all the arrays since it's a function called very often."
EDIT2 : is_user_alive(id) should be move in get_pcvar_num() check. One time is enough. And to avoid is_user_alive( target ), simply add "a" flag to get_players().

Schwabba 12-07-2010 07:39

Re: Wallbang Training
 
Okay, but when the player is turning around with his mouse, then the hitbox of the head is changing all the time, it's not the middle of the body with an other z-axis.

When the player is crouching, then i can't just add the same amount of units to the z-axis, i have to check if the player is standing or crouching before, i think it's much better with GetBonePosition.

I can change it if you want, but in my case, i would not.

You know how many units i have to change, when standing and couching?

Arkshine 12-07-2010 07:56

Re: Wallbang Training
 
I was not thought about the crouching. So, yes, you're right, keeping GetBonePosition is ok.

Btw, please check my edits above.

Schwabba 12-07-2010 10:53

Re: Wallbang Training
 
Changed, but now i got some weird bugs.

When i remove is_user_alive(Target), the server crashes (Mod_Extradata: caching failed).

And on my linux testserver i can't see the laserbeams anymore when i use client_prethink (same on older versions).. on my lan server it works..

When i change the prethink to a clcmd, then i see them for a short time.

Arkshine 12-07-2010 13:22

Re: Wallbang Training
 
About the error, no idea. It's related to GetBonePosition and something a cache check. So the flags "a" doesn't work as expected here. Weird.

Anyway :

- You forget #include <engine> ; it's an engine forward. If it works, it's because the module is already loaded by another plugin. The reason it doesn't work in your linux server.
- What is : "pev(id, pev_team, Origin)" ? Remove it.
- Change your first new with static.

Schwabba 12-07-2010 22:50

Re: Wallbang Training
 
Ok, changed, but i still have to use is_user_alive(Target).


All times are GMT -4. The time now is 21:01.

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