//find what weapon type the player has
switch(get_user_weapon(player))
{
case CSW_P228 : ca = 13;
case CSW_SCOUT : ca = 10;
case CSW_HEGRENADE : ca = 1;
case CSW_XM1014 : ca = 7;
case CSW_C4 : ca = 1;
case CSW_MAC10 : ca = 30;
case CSW_AUG : ca = 30;
case CSW_SMOKEGRENADE : ca = 1;
case CSW_ELITE : ca = 15;
case CSW_FIVESEVEN : ca = 20;
case CSW_UMP45 : ca = 25;
case CSW_SG550 : ca = 30;
case CSW_GALI : ca = 35;
case CSW_FAMAS : ca = 25;
case CSW_USP : ca = 12;
case CSW_GLOCK18 : ca = 20;
case CSW_AWP : ca = 10;
case CSW_MP5NAVY : ca = 30;
case CSW_M249 : ca = 100;
case CSW_M3 : ca = 8;
case CSW_M4A1 : ca = 30;
case CSW_TMP : ca = 30;
case CSW_G3SG1 : ca = 20;
case CSW_FLASHBANG : ca = 2;
case CSW_DEAGLE: ca = 7;
case CSW_SG552 : ca = 30;
case CSW_AK47 : ca = 30;
case CSW_P90 : ca = 50;
}
so when you use first plugin, the first plugin sets more ammo to the clip, but second one sets back the clip to normal limits, e.g. first plugin makes ak47 ammo 45, second plugin makes it back to 30, and just adds the ammo from there when you shoot. Anybody know what to do? need to make these plugins not collide somehow
Weapons MaxClip is free software;
you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Weapons MaxClip; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
// GLOBAL VARIABLES
new gHeroID
new const gHeroName[] = "Super Sizer"
new bool:gHasTrigger[SH_MAXSLOTS+1]
new HamHook:g_iHhPostFrame[CSW_P90+1]
new HamHook:g_iHhAttachToPlayer[CSW_P90+1]
new HamHook:g_iHhWeapon_WeaponIdle[ShotGuns]
public plugin_init()
{
register_plugin("SUPERHERO Trigger", VERSION, "1sh0t2killz")
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
new pcvarLevel = register_cvar("trigger_level", "0")
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
gHeroID = sh_create_hero(gHeroName, pcvarLevel)
sh_set_hero_info(gHeroID, "Bigger ammo clips", "OHHHHHHHH your ammo clips can hold more bullets now son.")
// Support for instant reload (used for example in my plugin "Reloaded Weapons On New Round")
// It's possible in default cs
if( get_pdata_int(iEnt, m_fInReload, XTRA_OFS_WEAPON) && get_pdata_float(id, m_flNextAttack, 5) <= 0.0 )
{
new j = min(iMaxClip - iClip, iBpAmmo)
set_pdata_int(iEnt, m_iClip, iClip + j, XTRA_OFS_WEAPON)
set_pdata_int(id, 381, iBpAmmo-j, XTRA_OFS_PLAYER)
public sh_hero_init(id, heroID, mode)
{
if ( gHeroID != heroID ) return
gHasHero[id] = mode ? true : false
}
public add_bullets()
{
if ( !sh_is_active() ) return
static players[32], playerCount, player, i
get_players(players, playerCount, "ah")
for ( i = 0; i < playerCount; i++ )
{
player = players[i]
if ( gHasHero[player] )
{
new ca
//find what weapon type the player has
switch(get_user_weapon(player))
{
case CSW_P228 : ca = 13;
case CSW_SCOUT : ca = 10;
case CSW_HEGRENADE : ca = 1;
case CSW_XM1014 : ca = 7;
case CSW_C4 : ca = 1;
case CSW_MAC10 : ca = 30;
case CSW_AUG : ca = 30;
case CSW_SMOKEGRENADE : ca = 1;
case CSW_ELITE : ca = 15;
case CSW_FIVESEVEN : ca = 20;
case CSW_UMP45 : ca = 25;
case CSW_SG550 : ca = 30;
case CSW_GALI : ca = 35;
case CSW_FAMAS : ca = 25;
case CSW_USP : ca = 12;
case CSW_GLOCK18 : ca = 20;
case CSW_AWP : ca = 10;
case CSW_MP5NAVY : ca = 30;
case CSW_M249 : ca = 100;
case CSW_M3 : ca = 8;
case CSW_M4A1 : ca = 30;
case CSW_TMP : ca = 30;
case CSW_G3SG1 : ca = 20;
case CSW_FLASHBANG : ca = 2;
case CSW_DEAGLE: ca = 7;
case CSW_SG552 : ca = 30;
case CSW_AK47 : ca = 30;
case CSW_P90 : ca = 50;
}
new currentAmmo = cs_get_weapon_ammo(get_pdata_cbase( player, 373 ))
new newAmmo = currentAmmo+get_pcvar_num(pcvarAmmoToAdd)
//This checks if ca is higher or the equal to the new ammo which will be set
if (newAmmo <= ca)
{
//Now lets set the new ammo!
cs_set_weapon_ammo(get_pdata_cbase( player, 373 ), newAmmo)
}
//what if ca = 30, and new ammo is bigger than the max? then new ammo will be 32 in a 30 max clip weapon??
else
{
//Then we just set the max bullets into the gun!
cs_set_weapon_ammo(get_pdata_cbase( player, 373 ), ca)
}
}
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1030\\ f0\\ fs16 \n\\ par }
*/
Thank you.
heliumdream
07-08-2016 10:46
Re: [Bug] Needs a fix
1) Just why? If a player has Punisher, they have effectively infinite ammo...who cares if you have a larger clip?
2) This is not so much a bug, but a code collision.
I didn't look super hard, but make sure the number tables in both scripts share the same values.
The values you punch in for trigger, you should make the same changes to the punisher script.
This should make punisher aware of the newer, bigger clip sizes initiated by trigger.
New and Clueless
07-08-2016 13:03
Re: [Bug] Needs a fix
Quote:
Originally Posted by heliumdream
(Post 2434728)
1) Just why? If a player has Punisher, they have effectively infinite ammo...who cares if you have a larger clip?
2) This is not so much a bug, but a code collision.
I didn't look super hard, but make sure the number tables in both scripts share the same values.
The values you punch in for trigger, you should make the same changes to the punisher script.
This should make punisher aware of the newer, bigger clip sizes initiated by trigger.
1) The version of punisher I use adds ammo every second instead of just spray non stop. I still want there to be a reload time, so with bigger ammo clips you can shoot longer without reload.
2) Yes, one code sets ammo as 45 and other code sets it back to 30 and they keep fighting.
Think you can do it? I don't have much of an idea of how I would do this.
//Punisher
case CSW_P228 : ca = 13;
case CSW_SCOUT : ca = 10;
case CSW_HEGRENADE : ca = 1;
case CSW_XM1014 : ca = 7;
case CSW_C4 : ca = 1;
case CSW_MAC10 : ca = 30;
case CSW_AUG : ca = 30;
case CSW_SMOKEGRENADE : ca = 1;
case CSW_ELITE : ca = 15;
case CSW_FIVESEVEN : ca = 20;
case CSW_UMP45 : ca = 25;
case CSW_SG550 : ca = 30;
case CSW_GALI : ca = 35;
case CSW_FAMAS : ca = 25;
case CSW_USP : ca = 12;
case CSW_GLOCK18 : ca = 20;
case CSW_AWP : ca = 10;
case CSW_MP5NAVY : ca = 30;
case CSW_M249 : ca = 100;
case CSW_M3 : ca = 8;
case CSW_M4A1 : ca = 30;
case CSW_TMP : ca = 30;
case CSW_G3SG1 : ca = 20;
case CSW_FLASHBANG : ca = 2;
case CSW_DEAGLE: ca = 7;
case CSW_SG552 : ca = 30;
case CSW_AK47 : ca = 30;
case CSW_P90 : ca = 50;
//Punisher
case CSW_P228 : ca = 13;
case CSW_SCOUT : ca = 10;
case CSW_HEGRENADE : ca = 1;
case CSW_XM1014 : ca = 7;
case CSW_C4 : ca = 1;
case CSW_MAC10 : ca = 30;
case CSW_AUG : ca = 30;
case CSW_SMOKEGRENADE : ca = 1;
case CSW_ELITE : ca = 15;
case CSW_FIVESEVEN : ca = 20;
case CSW_UMP45 : ca = 25;
case CSW_SG550 : ca = 30;
case CSW_GALI : ca = 35;
case CSW_FAMAS : ca = 25;
case CSW_USP : ca = 12;
case CSW_GLOCK18 : ca = 20;
case CSW_AWP : ca = 10;
case CSW_MP5NAVY : ca = 30;
case CSW_M249 : ca = 100;
case CSW_M3 : ca = 8;
case CSW_M4A1 : ca = 30;
case CSW_TMP : ca = 30;
case CSW_G3SG1 : ca = 20;
case CSW_FLASHBANG : ca = 2;
case CSW_DEAGLE: ca = 7;
case CSW_SG552 : ca = 30;
case CSW_AK47 : ca = 30;
case CSW_P90 : ca = 50;
Ok now lets say I pick m4a1, I have 30 ammo, after few seconds punisher adds it up to 45, it doesn't stop at 30. So trigger is useless now, because punisher kind of has that superhero now.