Raised This Month: $51 Target: $400
 12% 

[HL] Plugin edition request


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HiDeath
Senior Member
Join Date: Aug 2018
Location: Tunisia
Old 12-15-2019 , 11:49   [HL] Plugin edition request
Reply With Quote #1

Anyone could edit the current plugin to give a player with ADMIN_LEVEL_H the current weapons when he's spawned (with bpammos):
  • Shotgun
  • Leap (long jump)
  • Suit
  • Full Armor (100)
  • Antidote
  • MP5
  • 5 Laser Tripmines
  • Hivehand
  • Colt Python .357 Magnum

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <fakemeta>
#include <hamsandwich>

new const VERSION[] = "3.0.0"

const ACCESS_LEVEL ADMIN_LEVEL_A

new Trie:g_tItems

public plugin_init()
{
    
register_plugin("Half Life Give Items And Weapons"VERSION"tuty")

    
register_concmd("hl_weapon""ConCmd_GiveWeapon"ACCESS_LEVEL"<name> <weapon / @ALL> - give player a weapon | @ALL = all weapons" )
    
register_concmd"hl_item""ConCmd_GiveItem"ACCESS_LEVEL"<name> <item / @ALL> - give player a item | @ALL = all items" )

    
g_tItems TrieCreate()

    
TrieSetString(g_tItems"suit""item_suit")
    
TrieSetString(g_tItems"battery""item_battery")
    
TrieSetString(g_tItems"antidote""item_antidote")
    
TrieSetString(g_tItems"security""item_security")
    
TrieSetString(g_tItems"longjump""item_longjump")
    
TrieSetString(g_tItems"healthkit""item_healthkit")
}

public 
plugin_end()
{
    
TrieDestroyg_tItems )
}

public 
ConCmd_GiveWeaponidlevelcid )
{
    if( !
cmd_accessidlevelcid) )
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
szTarget32 ]
    
read_argv1szTargetcharsmaxszTarget ) )
        
    new 
iTarget cmd_targetidszTargetCMDTARGET_ALLOW_SELF|CMDTARGET_ONLY_ALIVE )
    
    if( !
iTarget )
    {
        return 
PLUGIN_HANDLED
    
}

    new 
szWeaponName19 ] = "weapon_"    
    
read_argv2szWeaponName[7], charsmaxszWeaponName ) - )

    const 
WEAPON_CROWBAR 1
    
const WEAPON_SNARK 15

    
new iId

    
if( equali(szWeaponName[7], "@ALL") )
    {
        for(
iId WEAPON_CROWBARiId<=WEAPON_SNARKiId++)
        {
            
get_weaponname(iIdszWeaponNamecharsmax(szWeaponName))
            
Give_User_Weapon(iTargetszWeaponNameiId)
        }
    }
    else if( (
iId get_weaponid(szWeaponName)) > )
    {
        
Give_User_Weapon(iTargetszWeaponNameiId)
    }
    else
    {
        
console_printid"[HL] Invalid weapon name!" )
    }
    return 
PLUGIN_HANDLED
}  

Give_User_Weapon(const id, const szWeapon[], const iId)
{
    const 
URANIUM_MAX_CARRY 100
    
const _9MM_MAX_CARRY 250
    
const _357_MAX_CARRY 36
    
const BUCKSHOT_MAX_CARRY 125
    
const BOLT_MAX_CARRY 50
    
const ROCKET_MAX_CARRY 5
    
const HANDGRENADE_MAX_CARRY 10
    
const SATCHEL_MAX_CARRY 5
    
const TRIPMINE_MAX_CARRY 5
    
const SNARK_MAX_CARRY 15
    
const HORNET_MAX_CARRY 8
    
const M203_GRENADE_MAX_CARRY 10

    
new const g_iMaxAmmo[] = {0
        
BUCKSHOT_MAX_CARRY
        
_9MM_MAX_CARRY
        
M203_GRENADE_MAX_CARRY,
        
_357_MAX_CARRY
        
URANIUM_MAX_CARRY
        
ROCKET_MAX_CARRY
        
BOLT_MAX_CARRY
        
TRIPMINE_MAX_CARRY
        
SATCHEL_MAX_CARRY
        
HANDGRENADE_MAX_CARRY,
        
SNARK_MAX_CARRY
        
HORNET_MAX_CARRY
    
}

    const 
XTRA_OFS_PLAYER 5
    
    
const m_rgAmmo_Slot0 309

    
new iEnt
    
if( !user_has_weapon(idiId) )
    {
        
iEnt give_item(idszWeapon)
    }
    else
    {
        const 
m_rgpPlayerItems_Slot0 300
        
const MAX_ITEM_TYPES 6

        
const XTRA_OFS_WEAPON 4
        
const m_pNext 29
        
const m_iId 30    

        
for(new i=1i<MAX_ITEM_TYPESi++)
        {
            
iEnt get_pdata_cbase(idm_rgpPlayerItems_Slot0 iXTRA_OFS_PLAYER)
            while( 
pev_valid(iEnt) )
                {
                    if( 
get_pdata_int(iEntm_iIdXTRA_OFS_WEAPON) == iId )
                    {
                        
// not sure if break would exit the 2 loops
                        
goto set_bpammo
                    
}
                    
iEnt get_pdata_cbase(iEntm_pNextXTRA_OFS_WEAPON)
            }
        }
    }

set_bpammo:
    if( 
iEnt )
    {
        new 
iAmmoType
        iAmmoType 
ExecuteHam(Ham_Item_PrimaryAmmoIndexiEnt)
        if( 
iAmmoType > -)
        {
            
set_pdata_int(idm_rgAmmo_Slot0 iAmmoTypeg_iMaxAmmo[iAmmoType], XTRA_OFS_PLAYER)
        }
        
iAmmoType ExecuteHam(Ham_Item_SecondaryAmmoIndexiEnt)
        if( 
iAmmoType > -)
        {
            
set_pdata_int(idm_rgAmmo_Slot0 iAmmoTypeg_iMaxAmmo[iAmmoType], XTRA_OFS_PLAYER)
        }
    }
}

public 
ConCmd_GiveItemidlevelcid )
{
    if( !
cmd_accessidlevelcid) )
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
szTarget32 ]
    
read_argv1szTargetcharsmaxszTarget ) )
        
    new 
iTarget cmd_targetidszTargetCMDTARGET_ALLOW_SELF|CMDTARGET_ONLY_ALIVE )
    
    if( !
iTarget )
    {
        return 
PLUGIN_HANDLED
    
}

    new 
szItem[15]
    
read_argv2szItemcharsmaxszItem ) )

    if( 
equaliszItem"@ALL" ) )
    {
        
give_itemiTarget"item_battery" )
        
give_itemiTarget"item_healthkit" )
        
give_itemiTarget"item_longjump" )
        
give_itemiTarget"item_security" )
        
give_itemiTarget"item_antidote" )
        
give_itemiTarget"item_suit" )
    }
    else if( 
TrieGetString(g_tItemsszItemszItemcharsmax(szItem)) )
    {
        
give_item(iTargetszItem)
    }
    else
    {
        
console_printid"[HL] Invalid item name!" )
    } 
    return 
PLUGIN_HANDLED


Thanks in advance, it would be really appreciated!
__________________
Avoid cs 1.6 no steam, use the steam version clean full & original
HiDeath is offline
HiDeath
Senior Member
Join Date: Aug 2018
Location: Tunisia
Old 12-18-2019 , 11:29   Re: [HL] Plugin edition request
Reply With Quote #2

Anyone?
__________________
Avoid cs 1.6 no steam, use the steam version clean full & original
HiDeath is offline
HiDeath
Senior Member
Join Date: Aug 2018
Location: Tunisia
Old 12-20-2019 , 14:54   Re: [HL] Plugin edition request
Reply With Quote #3

UP!
__________________
Avoid cs 1.6 no steam, use the steam version clean full & original
HiDeath 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 18:36.


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