←  Dodatki

AMXX.pl: Support AMX Mod X i SourceMod

»
Wklejka 132015184813472 dodana przez MarWit, 01.11.2011 13:50
Typ:


132015184813472
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.
#include <amxmodx>
#include <fakemeta>
 
new const g_iWeaponMaxAmmo[33]= {-2, 52, 0, 90, 1, 32, 1, 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120, 30, 120, 200, 32, 90, 120, 90, 2, 35, 90, 90, 0, 100, -1, -1}
new bool:ma_klase[33];
 
public eventCurWeapon(id)
{
    if(!ma_klase[id])
        return PLUGIN_CONTINUE
 
    static iWeapon;
    iWeapon = get_user_weapon(id)
 
    if(iWeapon == CSW_DEAGLE)
        fm_set_user_bpammo(id, iWeapon, g_iWeaponMaxAmmo[iWeapon])
 
    return PLUGIN_CONTINUE
}
 
stock fm_set_user_bpammo(id, weapon, amount)
{
    static offset
 
    switch(weapon)
    {
        case CSW_AWP: offset = 377;
        case CSW_SCOUT, CSW_AK47,CSW_G3SG1: offset = 378;
        case CSW_M249: offset = 379;
        case CSW_M4A1, CSW_FAMAS,CSW_AUG,CSW_SG550,CSW_GALI ,CSW_SG552: offset = 380;
        case CSW_M3, CSW_XM1014: offset = 381;
        case CSW_USP, CSW_UMP45,CSW_MAC10: offset = 382;
        case CSW_FIVESEVEN, CSW_P90: offset = 383;
        case CSW_DEAGLE: offset = 384;
        case CSW_P228: offset = 385;
        case CSW_GLOCK18,CSW_MP5NAVY,CSW_TMP,CSW_ELITE: offset = 386;
        case CSW_FLASHBANG: offset = 387;
        case CSW_HEGRENADE: offset = 388;
        case CSW_SMOKEGRENADE: offset = 389;
        case CSW_C4: offset = 390;
        default: return;
    }
 
    set_pdata_int(id, offset, amount, 5);
}