View Single Post
DaxProxy
Senior Member
Join Date: Sep 2007
Old 08-05-2010 , 06:52   Re: [REQ] only admins can have money
Reply With Quote #3

Prethink is very poor way to do that, since it eats CPU.

PHP Code:
#include <amxmodx>
#include <cstrike>
 
#define IsUserAdmin(%1) (get_user_flags(%1) & ADMIN_KICK)
 
#define PLUGIN "Admin money Only"
#define VERSION "1.0"
#define AUTHOR "SpeeD"
 
 
public plugin_init() {
register_plugin(PLUGINVERSIONAUTHOR)
client_cmd"buy""BuyCmd", -1)
}
 
public 
BuyCmd(id)
{
new 
szMoney cs_get_user_money(id)
if(
szMoney && !IsUserAdmin(id))
cs_set_user_money(id,0)

Whenever player tries to buy something using buymenu, their money will get nulled...but only works when players use money for default buymenu.

If you have some kind of shopmenu, then just change client_cmd to:
client_cmd( "say /shopmenu", "BuyCmd", -1)
__________________

Want ApolloRP for Counter-Strike? Show your support: http://forums.alliedmods.net/showthr...39#post1264739

Last edited by DaxProxy; 08-05-2010 at 06:55.
DaxProxy is offline