Modificare plugin refill on kill [rezolvat!]

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
WickeDCSX
Membru, skill +1
Membru, skill +1
Posts: 114
Joined: 15 Mar 2015, 23:13
Detinator Steam: Da
CS Status: linux
Detinator server CS: GO.ELDERS.RO
SteamID: DA
Fond eXtream: 0
Location: Suceava
Contact:

08 Aug 2018, 05:28

[!]As dori refill ammo on kill pe flag
| Afiseaza codul
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "Refill Weapon On Kill"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.2"

#define m_iId                43
#define m_iPrimaryAmmoType    49
#define m_fInReload            54

#define m_flNextAttack    83
#define m_pActiveItem    373
#define m_rgAmmo_Player_Slot0    376

#define IsPlayer(%1)    ( 1 <= %1 <= g_iMaxPlayers )

const NOCLIP_WPN_BS    = ((1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))

new g_iMaxPlayers

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)

    RegisterHam(Ham_Killed, "player", "Player_Killed", 1)

    g_iMaxPlayers = get_maxplayers()
}

public Player_Killed(iVictim, iKiller, iGib)
{
    if( IsPlayer(iKiller) && is_user_alive(iKiller) )
    {
        new iWeapon = get_pdata_cbase(iKiller, m_pActiveItem)
        if(    iWeapon > 0
        &&    !( NOCLIP_WPN_BS & (1<<get_pdata_int(iWeapon, m_iId, 4)) )    )
        {
            new Float:flNextAttack = get_pdata_float(iKiller, m_flNextAttack, 5)
            set_pdata_float(iKiller, m_flNextAttack, -0.001, 5)

            new iButton = pev(iKiller, pev_button)
            set_pev(iKiller, pev_button, iButton & ~(IN_ATTACK|IN_ATTACK2|IN_RELOAD))
            set_pdata_int(iWeapon, m_fInReload, 1, 4)
            ExecuteHamB(Ham_Item_PostFrame, iWeapon)

            set_pdata_int(iKiller, m_rgAmmo_Player_Slot0 + get_pdata_int(iWeapon, m_iPrimaryAmmoType, 4), 200)
            set_pdata_float(iKiller, m_flNextAttack, flNextAttack, 5)
            set_pev(iKiller, pev_button, iButton)
        }
    }
}
Image
RoyalServer 2
User avatar
A k c 3 n 7
Super moderator
Super moderator
Posts: 5139
Joined: 25 Aug 2014, 21:31
Detinator Steam: Da
CS Status: who dares wins
SteamID: Jandarmeria
Reputatie: Super moderator
Moderatorul anului 2023
Fost Membru Club eXtreamCS ( o luna )
Fost eXtream Mod
Fost Intermediar
Nume anterior: Sorinel
Fond eXtream: 0
Location: Unknown
Discord: remusakcent
Has thanked: 4 times
Been thanked: 46 times

08 Aug 2018, 16:07

| Afiseaza codul
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "Refill Weapon On Kill"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.2"

#define m_iId                43
#define m_iPrimaryAmmoType    49
#define m_fInReload            54

#define m_flNextAttack    83
#define m_pActiveItem    373
#define m_rgAmmo_Player_Slot0    376

#define IsPlayer(%1)    ( 1 <= %1 <= g_iMaxPlayers )

const NOCLIP_WPN_BS    = ((1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))

new g_iMaxPlayers

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)

    RegisterHam(Ham_Killed, "player", "Player_Killed", 1)

    g_iMaxPlayers = get_maxplayers()
}

public Player_Killed(iVictim, iKiller, iGib)
{
    if( IsPlayer(iKiller) && is_user_alive(iKiller) && get_user_flags( iKiller ) & ADMIN_LEVEL_H )
    {
        new iWeapon = get_pdata_cbase(iKiller, m_pActiveItem)
        if(    iWeapon > 0
        &&    !( NOCLIP_WPN_BS & (1<<get_pdata_int(iWeapon, m_iId, 4)) )    )
        {
            new Float:flNextAttack = get_pdata_float(iKiller, m_flNextAttack, 5)
            set_pdata_float(iKiller, m_flNextAttack, -0.001, 5)

            new iButton = pev(iKiller, pev_button)
            set_pev(iKiller, pev_button, iButton & ~(IN_ATTACK|IN_ATTACK2|IN_RELOAD))
            set_pdata_int(iWeapon, m_fInReload, 1, 4)
            ExecuteHamB(Ham_Item_PostFrame, iWeapon)

            set_pdata_int(iKiller, m_rgAmmo_Player_Slot0 + get_pdata_int(iWeapon, m_iPrimaryAmmoType, 4), 200)
            set_pdata_float(iKiller, m_flNextAttack, flNextAttack, 5)
            set_pev(iKiller, pev_button, iButton)
        }
    }
}
WickeDCSX
Membru, skill +1
Membru, skill +1
Posts: 114
Joined: 15 Mar 2015, 23:13
Detinator Steam: Da
CS Status: linux
Detinator server CS: GO.ELDERS.RO
SteamID: DA
Fond eXtream: 0
Location: Suceava
Contact:

18 Aug 2018, 21:47

Mersi . Merge !!!
Image
User avatar
j a h k 0-
Membru, skill +4
Membru, skill +4
Posts: 1536
Joined: 26 Jan 2016, 10:24
Detinator Steam: Da
CS Status: segmentation fault
SteamID: /ID/jkhalibu
Reputatie: Utilizator neserios
Restrictie moderator [permanent]
Membru Club eXtreamCS (3 luni)
Nume anterior: Jah#
Fond eXtream: 0
Location: Chişinău, Republic Of Moldova
Has thanked: 69 times
Been thanked: 13 times
Contact:

19 Sep 2018, 15:12

Rezolvat.
Tranzactii efectuate cu succes.
| Afiseaza codul
anunturi/vand-cont-rockstar-gta-15euro- ... 49363.html
anunturi/vand-cont-rockstar-gta-euro-paypal-t349373.html
anunturi/cumpar-tema-ipb-t349335.html
anunturi/recomandare-utilizatori-pentru-tranzactii-t323814-60.html
anunturi/recomandare-utilizatori-pentru-tranzactii-t323814-72.html
post2692853.html#p2692853
anunturi/addons-furien-classic-cyby-t348802.html
Image
| Afiseaza codul
Image
Image
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: Yandex [Bot] and 23 guests