Counter-Strike 1.6 Icon CS1.6 Script

[AMXX] Real Armor

Hello world. We are one of the oldest mod sites on the Interwebs. Sign up and maximize your browsing experience.

  • Subscribe: Get notified of new submissions like this.
  • Say Thanks: Show your appreciation by sending Rj. points.
  • Post: Give Rj. your thoughts on this Script.
  • Vote: Help Rj. win the Monthly Awards.
  • Rate: Give this Script a rating out of 10.
  • Flag: Alert moderators and warn members of a problem with this Script.
  • Watch: Get notified when this Script is updated.
Mascot

Join the community!

Sign up

Already a Bananite? Login

Realistic Vest and Helmet

100 lines | 2 kb | Raw Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/**
 *
 * Description:
 *  This is a _WORKING_ real armor plugin for Counter-Strike.
 *
 *
 * Commands / Cvars:
 *  Cvar: "ra_kevlar_flags"   "cd"  // armor flags for normal armor
 *  Cvar: "ra_vesthelm_flags" "bcd" // armor flags for armor with vest helmet
 *  + cvar flags:
 *  - "a" unknown (explosion for example)
 *  - "b" head
 *  - "c" chest
 *  - "d" stomatch
 *  - "e" leftarm
 *  - "f" rightarm
 *  - "g" leftleg
 *  - "h" rightleg
 *
 *
 * Requires:
 *  CStrike
 *  CSX
 *  Fun
 *
 *
 * Additional Info:
 *  Tested with amxmodx 1.8.1. But should work with some older amxx versions.
 *
 *
 * Notes:
 *  + Armor scan is preformed after damage is taken so deadly hits will be the way they should (awp hit for example).
 *
 *
 * ChangeLog:
 *
 *  + 1.1 (1114 downloads reseted)
 *  - Fixed: When armor is set to 0 you cannot pick it up again.
 *  - Changed: Code style.
 *
 *  + 1.0
 *  - First release.
 *
 *
 * Downloads:
 *  AMXMODX Community: http://forums.alliedmods.net/showthread.php?t=70773
 *
**/


#include <amxmodx>
#include <cstrike>
#include <csx>
#include <fun>

#define PLUGIN_NAME    "Real Armor"
#define PLUGIN_VERSION "1.1"
#define PLUGIN_AUTHOR  "Numb"

new g_iCvarP_karmor;
new g_iCvarP_varmor;

public plugin_init()
{
        register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
       
        g_iCvarP_karmor = register_cvar("ra_kevlar_flags",   "cd");
        g_iCvarP_varmor = register_cvar("ra_vesthelm_flags", "bcd");
}

public client_damage(iAttacker, iVictim, iDamage, iWpnIndex, iHitPlace, iTA)
{
        if( is_user_alive(iVictim) && iDamage>0 )
        {
                static s_iArmor, CsArmorType:s_iArmorType;
                s_iArmor = cs_get_user_armor(iVictim, s_iArmorType);
                if( s_iArmor>0 && s_iArmorType!=CS_ARMOR_NONE )
                {
                        if( get_armor_cvar_flags((s_iArmorType==CS_ARMOR_VESTHELM)?true:false)&(1<<iHitPlace) )
                        {
                                if( s_iArmor>iDamage )
                                {
                                        set_user_health(iVictim, get_user_health(iVictim)+iDamage);
                                        cs_set_user_armor(iVictim, s_iArmor-iDamage, s_iArmorType);
                                }
                                else
                                {
                                        set_user_health(iVictim, get_user_health(iVictim)+s_iArmor);
                                        cs_set_user_armor(iVictim, 0, CS_ARMOR_NONE);
                                }
                        }
                }
        }
}

get_armor_cvar_flags(bool:bVestHelm)
{
        static s_iCvarStr[32];
        get_pcvar_string(bVestHelm?g_iCvarP_varmor:g_iCvarP_karmor, s_iCvarStr, 31);
        return read_flags(s_iCvarStr);
}
Description:
This is more an engine bug fix plugin - makes armor act more real.
Cvars:
* "ra_kevlar_flags" "cd" // armor flags for normal armor
* "ra_vesthelm_flags" "bcd" // armor flags for armor with vest helmet

Cvar flags:
a - unknown (e.x. grenade)
b - head
c - chest
d - stomach
e - leftarm
f - rightarm
g - leftleg
h - rightleg
Requires:
CStrike
CSX
Fun
Additional info:
Tested with amxmodx 1.8.1. But shold work with some older amxx versions. Why I made this plugin? - Yes there are pritty much of real armor plugins, but there were no working ones for Counter-Strike untill this one!!! (When my scripting level wasn't like now - I searched all forums for this type of plugin, but none were working.) I didn't use pre-damage, cuz it wold be crazy if you had to hit a player with awp twice, so I made armor-format check after damage.

Change-Log:

1.1
Fixed: When armor is set to 0 you cannot pick it up again.
Changed: Code style.

1.0
- First release.

Posts

  • 2mo
    Rj. avatar
    Rj. avatar IN PLAYGROUND
    Studios > Black Mesa Inc.
    Member Joined 10mo
    1,032 points Ranked 4381st
    35 medals 4 legendary 9 rare
    • Submitted 15 Tools Medal icon
    • Submitted 50 Gamefiles Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2016 Medal icon
    • Thanked 500 submitters Medal icon
    • 2nd Place - Game Poetry Contest Medal icon
    • Submitted 5 Tools Medal icon
    Report post
    Please research or re-install AMXModX in your game.
    (❍ᴥ❍ʋ)
  • 2mo
    Bloody Death Skull avatar
    Bloody Death Skull avatar In The Shadows
    Member Joined 1y
    Report post
    Posted by Rj.

    Posted by Bloody Death Skull

    where i found csx and cstrike modules?
    You don't need to find those modules, it's automatically loads by the default amxmodx engine. If you have any problems, you can find those cstrike (cstrike_amxx.dll) and csx (csx_amxx.dll) module right inside of amxmodx/modules folder, otherwise you can also check your amxmodx modules' configuration settings (amxmodx/configs/modules.ini)
    if you are meaning cstrike/addons/modules
    there arent those modules in my folder
    that is why i asking
    Mapper,Texturer,Skinner... avatar
    Mantra
    Mapper,Texturer,Skinner...
  • 2mo
    Rj. avatar
    Rj. avatar IN PLAYGROUND
    Studios > Black Mesa Inc.
    Member Joined 10mo
    1,032 points Ranked 4381st
    35 medals 4 legendary 9 rare
    • Submitted 15 Tools Medal icon
    • Submitted 50 Gamefiles Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2016 Medal icon
    • Thanked 500 submitters Medal icon
    • 2nd Place - Game Poetry Contest Medal icon
    • Submitted 5 Tools Medal icon
    Report post
    Posted by Bloody Death Skull

    where i found csx and cstrike modules?
    You don't need to find those modules, it's automatically loads by the default amxmodx engine. If you have any problems, you can find those cstrike (cstrike_amxx.dll) and csx (csx_amxx.dll) module right inside of amxmodx/modules folder, otherwise you can also check your amxmodx modules' configuration settings (amxmodx/configs/modules.ini)
    (❍ᴥ❍ʋ)
  • 2mo
    Bloody Death Skull avatar
    Bloody Death Skull avatar In The Shadows
    Member Joined 1y
    Report post
    where i found csx and cstrike modules?
    Mapper,Texturer,Skinner... avatar
    Mantra
    Mapper,Texturer,Skinner...

Share

Shareable Image:
Share banner
HTML embed code:
BB embed code:
Markdown embed code:

More embeddable images

Bookmark and Share

Credits

Original Authors
MPNumB
MPNumB Offline
Member Joined 8y
AMXX Script/Codes

Submitter

Rj. avatar
Rj. avatar IN PLAYGROUND
Studios > Black Mesa Inc.
Member Joined 10mo
1,032 points Ranked 4381st
35 medals 4 legendary 9 rare
  • Submitted 15 Tools Medal icon
  • Submitted 50 Gamefiles Medal icon
  • 15+ Entries! GameBanana’s Christmas Giveaway 2016 Medal icon
  • Thanked 500 submitters Medal icon
  • 2nd Place - Game Poetry Contest Medal icon
  • Submitted 5 Tools Medal icon

Rj. avatar
Rj.

Redistributor
Are you the owner? Request Ownership
Send a Private Message to the submitter

Category

Attributes

Language
Pawn

Stats

Posts
4
Views
574
Date Added
2mo