Raised This Month: $ Target: $400
 0% 

Give Weapon By Command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Electric Boy
Member
Join Date: Jun 2017
Old 06-02-2017 , 13:18   Give Weapon By Command
Reply With Quote #1

Someone can make for me an simple plugin That if I write /m4a1 it will give me m4a1?
CS 1.6
Thanks For Helping

Last edited by Electric Boy; 06-02-2017 at 13:36.
Electric Boy is offline
Ayman Khaled
Senior Member
Join Date: Mar 2017
Location: Palestine
Old 06-02-2017 , 13:36   Re: Need this plugin please
Reply With Quote #2

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

#define VERSION "1.0"

public plugin_init() {

    
register_plugin("M4a1"VERSION"Ayman Khaled")
    
register_clcmd("say /m4a1""buy_m4a1")
    
}

public 
buy_m4a1(id
{

    if (
is_user_alive(id))
    {
        
give_item(id"weapon_m4a1")
        
client_print(idprint_chat"You have got m4a1!")
    }
    

__________________

Last edited by Ayman Khaled; 06-02-2017 at 13:41.
Ayman Khaled is offline
Electric Boy
Member
Join Date: Jun 2017
Old 06-02-2017 , 13:37   Re: Need this plugin please
Reply With Quote #3

Quote:
Originally Posted by Ayman Khaled View Post
PHP Code:
#include < amxmodx >
#include < fun >

#define VERSION "1.0"

public plugin_init() {

    
register_plugin("M4a1"VERSION"Ayman Khaled")
    
register_clcmd("say /m4a1""buy_m4a1")
    
}

public 
buy_m4a1(id) {
    
    if (
is_user_alive(id))
    {
        
give_item(id"weapon_m4a1")
        
client_print(idprint_chat"You have got m4a1!")
    }
    

Thanks man I love you
Electric Boy is offline
Houssam Benmouna
Senior Member
Join Date: Apr 2016
Old 06-02-2017 , 15:03   Re: Give Weapon By Command
Reply With Quote #4

xD useless
Houssam Benmouna is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-02-2017 , 16:00   Re: Give Weapon By Command
Reply With Quote #5

Fyi houssam its not useless if that what he requested


On topic cmd that give wpns

PHP Code:
#include amxmodx
#include amxmisc
#include fun
#include cstrike

public plugin_init() {

    
register_plugin("CMD GIVE WEAPON""1.0""Natsheh")
    
register_concmd("amx_weapon""cmd_wpn"ADMIN_KICK)
    
}

public 
cmd_wpn(idlevelcid)
{
       if(!
cmd_access(idlevelcid3)) return 1;
       new 
szTarget[32], szWpn[24], szAmmo[4];
       
read_argv(1szTargetcharsmax(szTarget))
       
read_argv(2szWpn23)
       
read_argv(3szAmmo3)
       new 
player cmd_target(idszTarget, ~CMDTARGET_OBEY_IMMUNITY)
       
format(szWpncharsmax(szWpn), "weapon_%s"szWpn)
       
strtolower(szWpn)
       if(!
player || !get_weaponid(szWpn)) return 1;
       
give_item(playerszWpn)
       
cs_set_user_bpammo(id,get_weaponid(szWpn),str_to_num(szAmmo))
       return 
1;

Example amx_weapon "Natsheh" "Ak47" "90" will give player nats.... An ak47
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 06-02-2017 at 21:00.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 06-02-2017 , 17:52   Re: Give Weapon By Command
Reply With Quote #6

A check for see If the player already has the weapon would be fine.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Electric Boy
Member
Join Date: Jun 2017
Old 06-02-2017 , 20:26   Re: Give Weapon By Command
Reply With Quote #7

Quote:
Originally Posted by Natsheh View Post
Fyi houssam its not useless if that what he requested


On topic cmd that give wpns

PHP Code:
#include amxmodx
#include amxmisc
#include fun
public plugin_init() {

    
register_plugin("CMD GIVE WEAPON""1.0""Natsheh")
    
register_concmd("amx_weapon""cmd_wpn"ADMIN_KICK)
    
}

public 
cmd_wpn(idlevelcid)
{
       if(!
cmd_access(idlevelcid2)) return 1;
       new 
szTarget[32], szWpn[24];
       
read_argv(1szTargetcharsmax(szTarget))
       
read_argv(2szWpn23)
       new 
player cmd_target(idszTarget)
       
format(szWpncharsmax(szWpn), "weapon_%s"szWpn)
       
strtolower(szWpn)
       if(!
player || !get_weaponid(szWpn)) return 1;
       
give_item(playerszWpn)
       return 
1;

Example amx_weapon "Natsheh" "Ak47" will give player nats.... An ak47

Heey man tnx for helping and Did you saw the first ? reply that Ayman posted? Can you tell me how to set the user ammo ?? l
Electric Boy is offline
Electric Boy
Member
Join Date: Jun 2017
Old 06-02-2017 , 20:29   Re: Give Weapon By Command
Reply With Quote #8

Quote:
Originally Posted by Natsheh View Post
Fyi houssam its not useless if that what he requested


On topic cmd that give wpns

PHP Code:
#include amxmodx
#include amxmisc
#include fun
public plugin_init() {

    
register_plugin("CMD GIVE WEAPON""1.0""Natsheh")
    
register_concmd("amx_weapon""cmd_wpn"ADMIN_KICK)
    
}

public 
cmd_wpn(idlevelcid)
{
       if(!
cmd_access(idlevelcid2)) return 1;
       new 
szTarget[32], szWpn[24];
       
read_argv(1szTargetcharsmax(szTarget))
       
read_argv(2szWpn23)
       new 
player cmd_target(idszTarget)
       
format(szWpncharsmax(szWpn), "weapon_%s"szWpn)
       
strtolower(szWpn)
       if(!
player || !get_weaponid(szWpn)) return 1;
       
give_item(playerszWpn)
       return 
1;

Example amx_weapon "Natsheh" "Ak47" will give player nats.... An ak47
LLOOOOOOOOOOOL Its says that im immunity xD
Electric Boy is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-02-2017 , 21:02   Re: Give Weapon By Command
Reply With Quote #9

I updated the code & iwrote it on the phone and you should br able to give ammo.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 06-02-2017 at 21:08.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Electric Boy
Member
Join Date: Jun 2017
Old 06-02-2017 , 21:08   Re: Give Weapon By Command
Reply With Quote #10

Thanks man

Last edited by Electric Boy; 06-02-2017 at 21:08.
Electric Boy 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:21.


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