AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   set_weapon_ammo incorrect on some weapons (https://forums.alliedmods.net/showthread.php?t=183517)

anakin_cstrike 04-22-2012 15:50

set_weapon_ammo incorrect on some weapons
 
Works fine with every weapon i've tested except for xm1014 and scout, it always sets to 1 ammo even if it should have set 2 or 3..
The value shown is correct though..
PHP Code:

static i_Weaponi_Ammoii_Bonus;
    
i_Bonus 5;
    if ( 
equal s_Weapon"weapon_scout" ) )
        
i_Bonus 3;
    if ( 
equal s_Weapon"weapon_m249" ) )
        
i_Bonus 8;
    if ( 
equal s_Weapon"weapon_awp" ) )
        
i_Bonus 2;
    if ( 
equal s_Weapon"weapon_xm1014" ) || equal s_Weapon"weapon_m3" ) )
        
i_Bonus 3;    
    
i_Weapon find_ent_by_owner ( -1s_Weaponi_Killer );
    
i_Ammo cs_get_weapon_ammo i_Weapon ) + i_Bonus;
cs_set_weapon_ammo i_Weaponi_Ammo );
client_print i_Killerprint_chat"+%i"i_Bonus ); 


Exolent[jNr] 04-24-2012 10:37

Re: set_weapon_ammo incorrect on some weapons
 
Going to need some more context of your code than that.


All times are GMT -4. The time now is 07:42.

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