Raised This Month: $12 Target: $400
 3% 

[Help] Give weapons ammo clip


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hoainam123
Member
Join Date: May 2014
Location: Viet Nam
Old 06-28-2016 , 07:44   [Help] Give weapons ammo clip
Reply With Quote #1

I have a CS 1.6 plugin that show menu list of weapons in game but when i choose a weapon, it just gives me only weapon, no BP ammo.

I need a script give full BP ammo for weapons. Thanks a lot !

Last edited by hoainam123; 06-28-2016 at 09:32.
hoainam123 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-28-2016 , 08:04   Re: [Help] Give weapons ammo clip
Reply With Quote #2

cs_set_user_bpammo(id, CSW_AK47, 90)
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
hoainam123
Member
Join Date: May 2014
Location: Viet Nam
Old 06-28-2016 , 08:47   Re: [Help] Give weapons ammo clip
Reply With Quote #3

Thanks man!!
and if i want unlimited bammo i use :
"cs_set_user_bpammo(id, CSW_AK47, 99999)"

right ?
hoainam123 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-28-2016 , 08:49   Re: [Help] Give weapons ammo clip
Reply With Quote #4

I have no idea, you can try. This probably works but in fact it isn't unlimited since you have 99999 bullets. There should be another way but i have no idea how.
__________________

Last edited by Napoleon_be; 06-28-2016 at 08:49.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
hoainam123
Member
Join Date: May 2014
Location: Viet Nam
Old 06-28-2016 , 09:09   Re: [Help] Give weapons ammo clip
Reply With Quote #5

Quote:
Originally Posted by Napoleon_be View Post
I have no idea, you can try. This probably works but in fact it isn't unlimited since you have 99999 bullets. There should be another way but i have no idea how.
i get crash when use 99999 ) anyway, thank u again
hoainam123 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-28-2016 , 09:11   Re: [Help] Give weapons ammo clip
Reply With Quote #6

Quote:
Originally Posted by hoainam123 View Post
i get crash when use 99999 ) anyway, thank u again
You should hook weapon reload and set max ammo again after reloading, i think that's how you set unlimited ammo.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
hoainam123
Member
Join Date: May 2014
Location: Viet Nam
Old 06-28-2016 , 09:39   Re: [Help] Give weapons ammo clip
Reply With Quote #7

PHP Code:

public un_ammo (id)
{
new 
CSW_MAXAMMO[33]=
{
    -
2,
    
52,
    
0,
    
90,
    
1,
    
32,
    
1,
    
100,
    
90,
    
1,
    
120,
    
100,
    
100,
    
90,
    
90,
    
90,
    
100,
    
120,
    
30,
    
120,
    
200,
    
32,
    
90,
    
120,
    
90,
    
2,
    
35,
    
90,
    
90,
    
0,
    
100,
    -
1,
    -
1
}
if(!
is_user_alive(id))
        return 
0

    
new weaponID read_data(2)
    if(
weaponID == CSW_C4 || weaponID == CSW_KNIFE || weaponID == CSW_HEGRENADE || weaponID == CSW_SMOKEGRENADE || weaponID == CSW_FLASHBANG)
        return 
PLUGIN_CONTINUE;
    
    
cs_set_user_bpammo(idweaponIDCSW_MAXAMMO[weaponID])
    
    return 
0

i found this. but i think it have problem :v
hoainam123 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-28-2016 , 09:42   Re: [Help] Give weapons ammo clip
Reply With Quote #8

nothing is included, no plugin_init and much more...

Anyways, this should be placed in the function of weapon reload hook. Search for it "Weapon Reload Hook AMXX"
__________________

Last edited by Napoleon_be; 06-28-2016 at 09:44.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-28-2016 , 11:23   Re: [Help] Give weapons ammo clip
Reply With Quote #9

This could be usefull: https://forums.alliedmods.net/showthread.php?t=123645
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 06-29-2016 , 22:37   Re: [Help] Give weapons ammo clip
Reply With Quote #10

Quote:
Originally Posted by Napoleon_be View Post
You should hook weapon reload and set max ammo again after reloading, i think that's how you set unlimited ammo.
Could you give an example of this please..
wicho 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 10:43.


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