Raised This Month: $ Target: $400
 0% 

How to change default clip ammos for the weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 04-28-2016 , 00:53   How to change default clip ammos for the weapon
Reply With Quote #1

How to change the default clip ammo when you give the weapon to player for the first time?
__________________
youtube:
@holla16

Last edited by 11922911; 04-28-2016 at 00:53.
11922911 is offline
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 04-28-2016 , 01:35   Re: How to change default clip ammos for the weapon
Reply With Quote #2

Another question, is it possible to change the ammo type of the weapon?
__________________
youtube:
@holla16
11922911 is offline
Kowalsky
Senior Member
Join Date: Mar 2015
Location: Poland
Old 04-28-2016 , 07:29   Re: How to change default clip ammos for the weapon
Reply With Quote #3

I think you have to hook ammox event and change the ammunition there. (According to the conditions)
__________________
I ONLY LOVE STEAM, NON-STEAM IS VERY BAD FOR YOUR HEALTH!
Kowalsky is offline
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 04-28-2016 , 09:55   Re: How to change default clip ammos for the weapon
Reply With Quote #4

I found the answer,
PHP Code:
public OnWeaponSpawn_Post(ent)
{
    
set_ent_data(ent"CBasePlayerWeapon""m_iDefaultAmmo"WEAPON_DEFAULT_GIVE);

__________________
youtube:
@holla16

Last edited by 11922911; 04-28-2016 at 09:56.
11922911 is offline
Kowalsky
Senior Member
Join Date: Mar 2015
Location: Poland
Old 04-28-2016 , 17:59   Re: How to change default clip ammos for the weapon
Reply With Quote #5

Can you provide the forward hook line? I bet it is a ham forward, right?
__________________
I ONLY LOVE STEAM, NON-STEAM IS VERY BAD FOR YOUR HEALTH!
Kowalsky is offline
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 04-29-2016 , 04:12   Re: How to change default clip ammos for the weapon
Reply With Quote #6

PHP Code:
RegisterHam(Ham_SpawnWEAPON_CLASS"OnWeaponSpawn_Post"1); 
__________________
youtube:
@holla16
11922911 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 19:18.


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