Raised This Month: $ Target: $400
 0% 

/give weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-03-2009 , 14:04   Re: /give weapon
Reply With Quote #1

no. watch this table http://wiki.amxmodx.org/CS_Weapons_Information

PHP Code:
public cmdGiveSG552id ) {
    
give_itemid"weapon_sg552" );
    
    
// you need to give ammo 3-6 times to fill the ammo.
    
give_itemid"ammo_556nato" );
    
give_itemid"ammo_556nato" );
    
give_itemid"ammo_556nato" );
    
give_itemid"ammo_556nato" );
    
give_itemid"ammo_556nato" );

__________________
xPaw is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-03-2009 , 16:00   Re: /give weapon
Reply With Quote #2

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


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