Raised This Month: $ Target: $400
 0% 

/give weapon


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-03-2009 , 16:00   Re: /give weapon
Reply With Quote #10

Better with cs_set_bpammo.

Example for all weapons, and max ammo for each weapon.

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>

#define PLUGIN "Give Weapon"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

new const g_iMaxBpAmmo[] = { -152, -190, -132110090, -1120100100909090100100,
        
30120200329012060, -1359090, -1100 }

public 
plugin_init()

    
register_plugin(PLUGINVERSIONAUTHOR)
     
    
register_clcmd"say""ClientCommand_GiveWeapon" )
    
register_clcmd"say_team""ClientCommand_GiveWeapon" )


public 
ClientCommand_GiveWeapon(id)
{
    new 
szArg1[14// smokegrenade

    
read_argv(1szArg1charsmax(szArg1))
    if( 
szArg1[0] == '/' )
    {
        new 
szWeaponName[20] = "weapon_" // weapon_smokegrenade
        
new iWeaponId
        add
(szWeaponNamecharsmax(szWeaponName), szArg1[1])
        if( ( 
iWeaponId get_weaponid(szWeaponName) ) )
        {
            
give_item(idszWeaponName)
            
cs_set_user_bpammo(idiWeaponIdg_iMaxBpAmmo[iWeaponId])
            return 
PLUGIN_HANDLED_MAIN
        
}
    }
    return 
PLUGIN_CONTINUE

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
 



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 02:25.


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