Raised This Month: $7 Target: $400
 1% 

No Wall Damage


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Fun Stuff        Approver:   Hawk552 (427)
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-18-2009 , 14:11   No Wall Damage
Reply With Quote #1

No Wall Damage

Disables damage through walls.
You can set that the attacker's and victim's screen to fade, so players can know when hitting something.

PHP Code:
/*
    Copyright © 2009, anakin_cstrike
    
    NoWall Damage is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with NoWall Damage; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
    
    - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - -
    
    - Modules:
        * Fakemeta
        * HamSandWich
   - Cvars:
        * nowalldamage 1/0 - enable/disable plugin [default 1]
        * nowalldamage_fade 0/1/2/3 - disable/ attacker/victim/both - screenfade [default 3]
*/ 
Attached Files
File Type: sma Get Plugin or Get Source (nowall_damage.sma - 4453 views - 2.4 KB)
__________________


Last edited by anakin_cstrike; 02-18-2009 at 15:17.
anakin_cstrike is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-18-2009 , 14:16   Re: No Wall Damage
Reply With Quote #2

Reserved
__________________

anakin_cstrike is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-18-2009 , 14:16   Re: No Wall Damage
Reply With Quote #3

Any improvement (except the fade feature) comparing to this one ? http://forums.alliedmods.net/showthread.php?p=418409


Code looks fine, have you tried to replace fm_is_ent_visible with Ham_FVisible ?
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 02-18-2009 at 14:20.
ConnorMcLeod is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 02-18-2009 , 14:21   Re: No Wall Damage
Reply With Quote #4

Quote:
Originally Posted by ConnorMcLeod View Post
Any improvement (except the fade feature) comparing to this one ? http://forums.alliedmods.net/showthread.php?p=418409
If this one don't have bugs, its code is much better.
__________________
joaquimandrade is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-18-2009 , 14:22   Re: No Wall Damage
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
Any improvement (except the fade feature) comparing to this one ? http://forums.alliedmods.net/showthread.php?p=418409


Code looks fine, have you tried to replace fm_is_ent_visible with Ham_FVisible ?
I thought somebody will say about ava's plugins. This is more effiecient and less code, without other functions like set_tr.
And no, i didn't tried Ham_FVisible, but maybe i'll give it a shot. Thanks.
__________________

anakin_cstrike is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-18-2009 , 14:39   Re: No Wall Damage
Reply With Quote #6

Would be better and more appropriate Ham_FVisible ; in the code, it adds some checks and ignores glass.

Use MSG_ONE_UNRELIABLE.

You should use always { } even for one line.

nowalldamage_fadevictim, nowalldamage_fadeattacker ; you would use one cvar.

new const PLUGIN[] ; pointless to do that. Use #define.

Last edited by Arkshine; 02-18-2009 at 14:45.
Arkshine is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-18-2009 , 14:48   Re: No Wall Damage
Reply With Quote #7

1. "Would be better and more appropriate Ham_FVisible ; in the code, it adds some checks and ignores glass."
I'm gonna use that function, but no testers avaible.
2. "Use MSG_ONE_UNRELIABLE."
I saw i put MSG_ONE when i edited the code with Ham_FVisible
3. "nowalldamage_fadevictim, nowalldamage_fadeattacker ; you would use one cvar."
Less control, don't you think ? if somebody wants to fade only the attacker's screens? or vice versa ?
4. "new const PLUGIN[] ; pointless to do that. Use #define." Hmm...okay, just this once
__________________

anakin_cstrike is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-18-2009 , 14:53   Re: No Wall Damage
Reply With Quote #8

3. You don't know about flag ?

MyCvar : 1 - Fade Victim ; 2 - Fade Attacker.

MyCvar "1" = fade only the victim
MyCvar "2" = fade only the attacker
MyCvar "3" = fade both.

if ( MyPointer & 1 ) //
if ( MyPointer & 2 ) //

Well, actually in this plugin, it may not necessary :p. It's more clear your way. :p

Last edited by Arkshine; 02-18-2009 at 14:55.
Arkshine is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-18-2009 , 15:18   Re: No Wall Damage
Reply With Quote #9

Updated:
- Using Ham_FVisible (tested - works)
- MSG_ONE_UNRELIABLE
- Using one cvar instead 2
__________________

anakin_cstrike is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-18-2009 , 15:25   Re: No Wall Damage
Reply With Quote #10

You did not read what I've written it seems :p
Arkshine 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 06:30.


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