Raised This Month: $32 Target: $400
 8% 

Walk through walls


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands        Approver:   Arkshine (91)
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 09-11-2014 , 16:25   Walk through walls
Reply With Quote #1

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.
Attached Files
File Type: sma Get Plugin or Get Source (amxx_walkthroughwalls.sma - 1690 views - 3.7 KB)
__________________
Retired.

Last edited by Xalus; 09-04-2015 at 17:18.
Xalus is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 09-11-2014 , 20:34   Re: Walk trought walls
Reply With Quote #2

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.
zmd94 is offline
5aloOod
Senior Member
Join Date: Jun 2013
Location: hell
Old 09-12-2014 , 03:25   Re: Walk trought walls
Reply With Quote #3

noclip?
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
5aloOod is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 09-12-2014 , 03:46   Re: Walk trought walls
Reply With Quote #4

It is different from noclip. ;)
zmd94 is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 09-12-2014 , 12:01   Re: Walk trought walls
Reply With Quote #5

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 ;)
__________________
Retired.
Xalus is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 09-12-2014 , 12:24   Re: Walk trought walls
Reply With Quote #6

Nice job.
__________________
Kia is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 09-12-2014 , 22:10   Re: Walk trought walls
Reply With Quote #7

Thank you for the explanation, Xalus. ;)
zmd94 is offline
Old 09-15-2014, 11:46
EthicalHacker007
This message has been deleted by EthicalHacker007.
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-03-2015 , 05:55   Re: Walk trough walls
Reply With Quote #8

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

Last edited by HamletEagle; 09-03-2015 at 06:35.
HamletEagle is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 09-04-2015 , 12:10   Re: Walk through walls
Reply With Quote #9

[v1.1]
- Optimized code
- And the other suggestions of HamletEagle.
__________________
Retired.
Xalus is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-04-2015 , 12:17   Re: Walk through walls
Reply With Quote #10

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

Last edited by HamletEagle; 09-04-2015 at 12:17.
HamletEagle is offline
Reply



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 01:09.


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