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_pcvarNoLoose, g_pcvarMoreMoney
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
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(iMsgId, MSG_DEST, id)
{
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 < 0 && get_pcvar_float(g_pcvarNoLoose) )
{
set_pdata_int(id, OFFSET_CSMONEY, iOldMoney)
return PLUGIN_HANDLED
}
new iFactor = get_pcvar_num(g_pcvarMoreMoney)
if( iDiff > 0 && iFactor > 1 )
{
iDiff *= iFactor
iNewMoney = min(iOldMoney + iDiff, 16000)
set_pdata_int(id, OFFSET_CSMONEY, iNewMoney)
set_msg_arg_int (1, ARG_LONG, iNewMoney)
}
g_iMoney[id] = iNewMoney
return PLUGIN_CONTINUE
}
__________________