AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Walk through walls (https://forums.alliedmods.net/showthread.php?t=248018)

Xalus 09-11-2014 16:25

Walk through walls
 
1 Attachment(s)
Walk through walls
A plugin that allows you to walk throught walls.


Changelog (Suggested by HamletEagle)
  • Optimized code
  • New features (Hold button, ...)
  • Extra cvars

Cvars
  • wtw_distance 60
    - Maximum wall width which player can go trough.

  • wtw_fall_distance 150
    - Maximum Fall distance behind the wall. (So you don't end up dead).

  • wtw_button 0
    - Button (USE) needed to go through walls (1) or automatically (0)

  • wtw_delay 0.7
    - Delay after going through a wall, to go through the next one.

  • wtw_message 0
    - Show a message to player if walking through wall failed.

zmd94 09-11-2014 20:34

Re: Walk trought walls
 
Nice plugin. ;)

By the way, may you explain more? What do you mean by "Distance from player, used for maximum wall width." and "Maximum fall height as you go through wall." as I'm quite confused.

5aloOod 09-12-2014 03:25

Re: Walk trought walls
 
noclip?

zmd94 09-12-2014 03:46

Re: Walk trought walls
 
It is different from noclip. ;)

Xalus 09-12-2014 12:01

Re: Walk trought walls
 
Distance from player for wall width:

A = Player
| = Wall
B = Distance from player

A | B

Actualy its just the max wall width +40.0

I may should make that cvar easyer in next version ;)

Kia 09-12-2014 12:24

Re: Walk trought walls
 
Nice job.

zmd94 09-12-2014 22:10

Re: Walk trought walls
 
Thank you for the explanation, Xalus. ;)

HamletEagle 09-03-2015 05:55

Re: Walk trough walls
 
Code looks good, except:

1.Drop the stock keyword in front of your functions.
2.Cvar caching is not needed here, you are not working in a forward called per frame.
3.Considering above, nothing should be static.
4.Add cvars description inside the source file or any other relevant informations. This way, the owner could easy find what he needs, without searching for the thread.

Some feature suggestions:

1.This could become a pain, what if I stand near a wall but I don't want to be teleported ? Add a button, like IN_USE which should be pressend in order to teleport. You can make a cvar to let admins decide if teleportation should be automatic or by a button.
2.You could add messages telling them why the teleportation failed, like wall is too big or stuff. Same, could be adjusted by cvars.
3.Add another cvar for the delay, maybe an owner wants more or less than 0.7.

Xalus 09-04-2015 12:10

Re: Walk through walls
 
[v1.1]
- Optimized code
- And the other suggestions of HamletEagle.

HamletEagle 09-04-2015 12:17

Re: Walk through walls
 
Fastly read your code, updates appear to be ok. Just:

1.intCvarButton and tr(from is_hull_vacant) should not be declared as static. static is usefull for example in a forward that's called usually per frame or on big arrays, to avoid going out of the stack size(basically allocating memory only one time).
2.get_pcvar_num(g_cvarMessages) should be cached inside the function because you are calling it more than one time(as you did for g_cvarButton).


All times are GMT -4. The time now is 19:15.

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