Raised This Month: $12 Target: $400
 3% 

Wallbang Training


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
Schwabba
Senior Member
Join Date: Apr 2008
Old 12-07-2010 , 04:34   Wallbang Training
Reply With Quote #1

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


Attached Files
File Type: sma Get Plugin or Get Source (Wallbang_Training.sma - 3426 views - 2.0 KB)

Last edited by Schwabba; 12-07-2010 at 22:46.
Schwabba is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-07-2010 , 05:22   Re: Wallbang Training
Reply With Quote #2

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]))

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.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Schwabba
Senior Member
Join Date: Apr 2008
Old 12-07-2010 , 06:26   Re: Wallbang Training
Reply With Quote #3

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.
Schwabba is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-07-2010 , 06:41   Re: Wallbang Training
Reply With Quote #4

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.
__________________

Last edited by Arkshine; 12-07-2010 at 06:47.
Arkshine is offline
Old 12-07-2010, 07:32
Schwabba
This message has been deleted by Schwabba.
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-07-2010 , 07:36   Re: Wallbang Training
Reply With Quote #5

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().
__________________

Last edited by Arkshine; 12-07-2010 at 07:42.
Arkshine is offline
Schwabba
Senior Member
Join Date: Apr 2008
Old 12-07-2010 , 07:39   Re: Wallbang Training
Reply With Quote #6

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?

Last edited by Schwabba; 12-07-2010 at 07:54.
Schwabba is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-07-2010 , 07:56   Re: Wallbang Training
Reply With Quote #7

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

Btw, please check my edits above.
__________________
Arkshine is offline
Schwabba
Senior Member
Join Date: Apr 2008
Old 12-07-2010 , 10:53   Re: Wallbang Training
Reply With Quote #8

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.
Schwabba is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-07-2010 , 13:22   Re: Wallbang Training
Reply With Quote #9

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.
__________________

Last edited by Arkshine; 12-07-2010 at 13:27.
Arkshine is offline
Old 12-07-2010, 13:47
bboygrun
This message has been deleted by bboygrun.
Schwabba
Senior Member
Join Date: Apr 2008
Old 12-07-2010 , 22:50   Re: Wallbang Training
Reply With Quote #10

Ok, changed, but i still have to use is_user_alive(Target).
Schwabba 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 10:15.


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