Raised This Month: $32 Target: $400
 8% 

Bullets


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 11-20-2013 , 13:59   Bullets
Reply With Quote #1

Am i doing something wrong here?
Im giving people bullets. But some people doesnt get bullets and some people do?
I realy dont now how to fix this

Here is an exemple from my last request

Code:
LR_Paintball( id )
{
	strip_user_weapons( id );
	give_item( id, "weapon_mp5navy" )
	cs_set_user_bpammo(id, CSW_MP5NAVY, 30)
	set_pev(id, pev_viewmodel2, g_szPaintball);
	set_pev(id, pev_weaponmodel2, g_szPaintball2);
	set_task( 0.1, "GiveAmmo", id, _,_, "b" )
						
	message_begin(MSG_ONE_UNRELIABLE, HideWeapon, _, id)
	write_byte(1<<6)
	message_end()
}
Code:
public GiveAmmo( iPlayer )
{
	if( is_user_alive( iPlayer ) )
	{		
		static clip, ammo
		if( g_iCurrentGame == LR_PAINTBALL)		
		{
			get_user_ammo( iPlayer, CSW_MP5NAVY, clip, ammo ) 
			if ( clip <= 0 ) 
			{
				cs_set_user_bpammo(iPlayer, CSW_MP5NAVY, 30)
			}  
		}
	}
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 11-20-2013 , 14:23   Re: Bullets
Reply With Quote #2

Show when functions are called

PS: unlimites bp ammo?
__________________
alan_el_more is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 11-20-2013 , 14:25   Re: Bullets
Reply With Quote #3

I dont think function have anything todo with this code.

This code makes so when you run out of ammo you get 30 clip to reload
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 11-20-2013 , 14:49   Re: Bullets
Reply With Quote #4

Found the bug

Code:
cl_lw 1
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 11-20-2013 , 21:17   Re: Bullets
Reply With Quote #5

To save code you can give_item inside the giving back pack ammo native.

Code:
cs_set_user_bpammo( id , give_item( id , " weapon_mp5navy" ), 30 );
__________________

Last edited by Blizzard_87; 11-20-2013 at 21:22.
Blizzard_87 is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 11-20-2013 , 23:35   Re: Bullets
Reply With Quote #6

Quote:
Originally Posted by Blizzard_87 View Post
To save code you can give_item inside the giving back pack ammo native.

Code:
cs_set_user_bpammo( id , give_item( id , " weapon_mp5navy" ), 30 );
give_item() returns the index of the entity created, not the CSW_* constant ( which is what is required in cs_set_user_bpammo() ).

Sounds like your thinking of cs_set_weapon_ammo() where you would set the clip amount of the created weapon.
hornet is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 11-20-2013 , 23:45   Re: Bullets
Reply With Quote #7

Quote:
Originally Posted by hornet View Post
give_item() returns the index of the entity created, not the CSW_* constant ( which is what is required in cs_set_user_bpammo() ).

Sounds like your thinking of cs_set_weapon_ammo() where you would set the clip amount of the created weapon.
oh crap your right sorry.. donno what i was thinking.
__________________
Blizzard_87 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 00:01.


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