Raised This Month: $248 Target: $400
 62% 

Help How To Give Weapon Ammo


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Anonymousstar
Junior Member
Join Date: Apr 2020
Old 09-12-2020 , 04:17   Help How To Give Weapon Ammo
Reply With Quote #1

I donot understand how to give ammo can anyone help

Code is here

Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>

#define PLUGIN "Random Guns"
#define VERSION "1.0"
#define AUTHOR "Anonymousstar"

new sec_weapon[][] =
{
    "weapon_usp",
    "weapon_glock",
    "weapon_deagle",
    "weapon_p228",
    "weapon_elite",
    "weapon_fiveseven"
}

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1)
}

public OnPlayerSpawn(id){
	
	if(is_user_alive(id))
	{
		new szWeapon = random( sizeof sec_weapon);
		strip_user_weapons(id);
		give_item(id, sec_weapon[ szWeapon]);
         }
}
Anonymousstar is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 09-12-2020 , 07:48   Re: Help How To Give Weapon Ammo
Reply With Quote #2

https://www.amxmodx.org/api/cstrike/cs_set_user_bpammo
__________________
Accepting private $$$ plugins requests.

@Steam: crazy770
@Discord: CrazY.#5317

Website | Channel

CrazY. is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-13-2020 , 20:09   Re: Help How To Give Weapon Ammo
Reply With Quote #3

Also this, just be aware that you must pass the weapon entity index, not CSW_* weapon ID.

http://www.amxmodx.org/api/cstrike/cs_set_weapon_ammo
__________________
Bugsy is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-14-2020 , 09:04   Re: Help How To Give Weapon Ammo
Reply With Quote #4

Weapon clip ammo is stored in the weapon entity ,backpack ammo is stored within the player entity.
__________________
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Last edited by Natsheh; 09-14-2020 at 09:05.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Reply


Thread Tools
Display Modes

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 08:16.


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