Raised This Month: $ Target: $400
 0% 

Infiniti ammo


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-21-2013 , 10:14   Re: Infiniti ammo
Reply With Quote #1

Code:
/*  Formatright © 2009, ConnorMcLeod     Infinite BpAmmo 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 Infinite BpAmmo; if not, write to the     Free Software Foundation, Inc., 59 Temple Place - Suite 330,     Boston, MA 02111-1307, USA. */ #include <amxmodx> #include <fakemeta> #include <hamsandwich> #define VERSION "0.0.1" enum {     CurWeapon_IsActive = 1, // byte     CurWeapon_WeaponID, // byte     CurWeapon_ClipAmmo // byte } const XO_CBASEPLAYERWEAPON = 4 const m_iClip = 51 const m_iClientClip = 52 const m_pActiveItem = 373 new Float:g_flPlayerInfinitAmmoEndTime[33] new const g_iMaxClip[CSW_P90+1] = {     -1,  13, -1, 10,  1,  7,    1, 30, 30,  1,  30,         20, 25, 30, 35, 25,   12, 20, 10, 30, 100,         8 , 30, 30, 20,  2,    7, 30, 30, -1,  50 } public plugin_init() {     register_plugin("Infinite Ammo", VERSION, "ConnorMcLeod")     register_message(get_user_msgid("CurWeapon"), "Message_CurWeapon") } public Message_CurWeapon(iMsgId, iMsgDest, id) {     if( get_msg_arg_int(CurWeapon_IsActive) && g_flPlayerInfinitAmmoEndTime[id] >= get_gametime() )     {         new iMaxClip = g_iMaxClip[  get_msg_arg_int( CurWeapon_WeaponID )  ]         if( iMaxClip > 2 && get_msg_arg_int(CurWeapon_ClipAmmo) < iMaxClip )         {             new iWeapon = get_pdata_cbase(id, m_pActiveItem)             if( iWeapon > 0 )             {                 set_pdata_int(iWeapon, m_iClip, iMaxClip, XO_CBASEPLAYERWEAPON)                 set_pdata_int(iWeapon, m_iClientClip, iMaxClip, XO_CBASEPLAYERWEAPON)                 set_msg_arg_int(CurWeapon_ClipAmmo, ARG_BYTE, iMaxClip)             }         }     } } // add in menu selection : {     // just selected infinit ammo :     g_flPlayerInfinitAmmoEndTime[id] = get_gametime() + 15.0 }
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
layka_LUBII
Senior Member
Join Date: Jul 2012
Old 04-21-2013 , 13:03   Re: Infiniti ammo
Reply With Quote #2

doesn´t work

Code:
enum
{
    CurWeapon_IsActive = 1, // byte
    CurWeapon_WeaponID, // byte
    CurWeapon_ClipAmmo // byte
}

const XO_CBASEPLAYERWEAPON = 4
const m_iClip = 51
const m_iClientClip = 52

const m_pActiveItem = 373

new Float:g_flPlayerInfinitAmmoEndTime[33]

new const g_iMaxClip[CSW_P90+1] = {
    -1,  13, -1, 10,  1,  7,    1, 30, 30,  1,  30, 
        20, 25, 30, 35, 25,   12, 20, 10, 30, 100, 
        8 , 30, 30, 20,  2,    7, 30, 30, -1,  50
}
Code:
register_message(get_user_msgid("CurWeapon"), "Message_CurWeapon")
Code:
public Message_CurWeapon(iMsgId, iMsgDest, id)
{
    if( get_msg_arg_int(CurWeapon_IsActive) && g_flPlayerInfinitAmmoEndTime[id] >= get_gametime())
    {
        new iMaxClip = g_iMaxClip[  get_msg_arg_int( CurWeapon_WeaponID )  ]
        if( iMaxClip > 2 && get_msg_arg_int(CurWeapon_ClipAmmo) < iMaxClip )
        {
            new iWeapon = get_pdata_cbase(id, m_pActiveItem)
            if( iWeapon > 0 )
            {
                set_pdata_int(iWeapon, m_iClip, iMaxClip, XO_CBASEPLAYERWEAPON)
                set_pdata_int(iWeapon, m_iClientClip, iMaxClip, XO_CBASEPLAYERWEAPON)

                set_msg_arg_int(CurWeapon_ClipAmmo, ARG_BYTE, iMaxClip)
            }
        }
    }
}
Code:
case 6:
		{
			if(get_user_flags(id) & ADMIN_LEVEL_H)
			if(money >= costunlimitedammo)
			{                         
				cs_set_user_money(id, money - costunlimitedammo)
				g_flPlayerInfinitAmmoEndTime[id] = get_gametime() + 15.0
				ChatColor(id, "!team[ Furien ] !yKupil si Nekonecnu municiu")
				} else {
				client_print(id, print_center, "Nemas dostatek penez")
				client_cmd(0, "speak %s", Sound)
			         } 
			         else 
			         {
				ChatColor(id, "!team[ Furien ] !yTato polozka je urcena vip hracom.")
			         }
		}
so it have and doesn´t work
layka_LUBII 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:53.


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