Raised This Month: $ Target: $400
 0% 

amx_adminmoney.amxx


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-30-2008 , 04:20   Re: amx_adminmoney.amxx
Reply With Quote #2

Try this :

PHP Code:
/*    Copyright © 2008, ConnorMcLeod

    More Money For Admins 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 More Money For Admins; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#define ADMIN_MONEY        ADMIN_SLAY

#include <amxmodx>
#include <fakemeta>

#define PLUGIN "More Money For Admins"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

#define MAX_PLAYERS    32

#define OFFSET_CSMONEY  115

new bool:g_bMoney[MAX_PLAYERS+1]
new 
g_iMoney[MAX_PLAYERS+1]

new 
g_pcvarNoLooseg_pcvarMoreMoney

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
g_pcvarNoLoose register_cvar("admin_money_noloose""1")
    
g_pcvarMoreMoney register_cvar("admin_money_factor""2")

    
register_message(get_user_msgid("Money"),"Message_Money")
}

public 
client_authorized(id)
{
    
g_bMoney[id] = bool:(get_user_flags(id) & ADMIN_MONEY)
    
g_iMoney[id] = 0
}

public 
Message_Money(iMsgIdMSG_DESTid)
{
    if( !
g_bMoney[id] )
        return 
PLUGIN_CONTINUE

    
new iOldMoney g_iMoney[id]
    new 
iNewMoney get_msg_arg_int(1)
    new 
iDiff iNewMoney iOldMoney

    
if( iDiff && get_pcvar_float(g_pcvarNoLoose) )
    {
        
set_pdata_int(idOFFSET_CSMONEYiOldMoney)
        return 
PLUGIN_HANDLED
    
}

    new 
iFactor get_pcvar_num(g_pcvarMoreMoney)

    if( 
iDiff && iFactor )
    {
        
iDiff *= iFactor
        iNewMoney 
min(iOldMoney iDiff16000)

        
set_pdata_int(idOFFSET_CSMONEYiNewMoney)
        
set_msg_arg_int (1ARG_LONGiNewMoney)
    }

    
g_iMoney[id] = iNewMoney
    
return PLUGIN_CONTINUE

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-30-2008 at 06:14.
ConnorMcLeod is offline
 



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 03:10.


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