Raised This Month: $51 Target: $400
 12% 

[REQ] only admins can have money


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Anonymous
Member
Join Date: Nov 2009
Location: Anonuser.org
Old 08-05-2010 , 01:50   [REQ] only admins can have money
Reply With Quote #1

tittle, can someone make plugin so only admins can have money?
__________________
This site is filled with shitters who call themselves experts.
Anonymous is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 08-05-2010 , 06:25   Re: [REQ] only admins can have money
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <fakemeta>
#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)
    
register_forward(FM_PlayerPreThink"Forward_PlayerPreThink")
}

public 
Forward_PlayerPreThink(id)
{
    new 
szMoney cs_get_user_money(id)
    if(
szMoney && !IsUserAdmin(id))
        
cs_set_user_money(id,0)

You can try this.It ressets the non admin player (that doesnt have admin_kick flag,you can change the flag to whatever you want) money to 0.
SpeeDeeR is offline
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
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 13:09.


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