Raised This Month: $ Target: $400
 0% 

/give weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-03-2009 , 13:10   /give weapon
Reply With Quote #1

Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fun>

#define PLUGIN "snipers"
#define VERSION "0.1"
#define AUTHOR "TitANious"


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("say /scout", "give_scout")
	register_clcmd("say /AWP", "give_awp")
	register_clcmd("say /sg552", "give_sg552")
	register_clcmd("say /g3sg1", "give_g3sg1")

public give_scout
{
	give_item, ("weapon_scout")
}
public give_g3sg1
{
	give_item, ("weapon_g3sg1")
}
public give_awp
{
	give_item, ("weapon_awp")
}
public give_sg552

	give_item, ("weapon_sg552")
}
Whats wrong? :S
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-03-2009 , 13:15   Re: /give weapon
Reply With Quote #2

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

#define PLUGIN        " Weapons? "
#define VERSION        "1.0"
#define AUTHOR        "TitANious (xPaw)"


public plugin_init( ) {
    
register_pluginPLUGINVERSIONAUTHOR );
    
    
register_clcmd"say /scout",    "cmdGiveScout" );
    
register_clcmd"say /sg552",    "cmdGiveSG552" );
    
register_clcmd"say /g3sg1",    "cmdGiveG3SG1" );
    
register_clcmd"say /awp",    "cmdGiveAWP" );
}

public 
cmdGiveScoutid ) {
    
give_itemid"weapon_scout" );
    
    
// dont forge to give some ammo :D
}

public 
cmdGiveSG552id ) {
    
give_itemid"weapon_sg552" );
    
    
// dont forge to give some ammo :D
}

public 
cmdGiveG3SG1id ) {
    
give_itemid"weapon_g3sg1" );
    
    
// dont forge to give some ammo :D
}

public 
cmdGiveAWPid ) {
    
give_itemid"weapon_awp" );
    
    
// dont forge to give some ammo :D

__________________

Last edited by xPaw; 04-03-2009 at 14:04.
xPaw is offline
Old 04-03-2009, 13:20
IneedHelp
This message has been deleted by IneedHelp. Reason: hi xpaw faster
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-03-2009 , 13:36   Re: /give weapon
Reply With Quote #4

Im new at scripting, how? I just found out on any way to make that i have now ;)
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-03-2009 , 13:56   Re: /give weapon
Reply With Quote #5

what you mean by "how"?
__________________
xPaw is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-03-2009 , 13:57   Re: /give weapon
Reply With Quote #6

Whats the code for it? For ammo
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-03-2009 , 13:58   Re: /give weapon
Reply With Quote #7

same with give_item, just you need to find right ammo names, and give like
PHP Code:
give_itemid"ammo-name" ); 
__________________
xPaw is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-03-2009 , 14:00   Re: /give weapon
Reply With Quote #8

Like
PHP Code:
give_itemid"ammo-sg552" ); 
?
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-03-2009 , 14:04   Re: /give weapon
Reply With Quote #9

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 #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
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