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

Help / Support [PLUGIN NEEDED] amx_givemoney


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GraviAnt
Senior Member
Join Date: Oct 2010
Old 05-24-2014 , 11:30   [PLUGIN NEEDED] amx_givemoney
Reply With Quote #1

As title says... I need a plugin that gives/takes selected player money with command for example:

amx_givemoney <nick> <+/-amount>
zp_givemoney <nick> <+/-amount>

I tried to find it by searching forums but without luck finding one that suits me.
GraviAnt is offline
Torge
Veteran Member
Join Date: Oct 2011
Old 05-24-2014 , 15:01   Re: [PLUGIN NEEDED] amx_givemoney
Reply With Quote #2

Tested.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

public plugin_init()
{
    
register_plugin("Give Money""1.0""Torge");
    
    
register_concmd("amx_givemoney""cmd_givemoney"ADMIN_RCON"<name> <money>");
}

public 
cmd_givemoney(idlevelcid)
{
    if(!
cmd_access(idlevelcid3))
        return 
PLUGIN_HANDLED;
        
    new 
szName[32], iMoney[6];
    
read_argv(1szNamecharsmax(szName));
    
read_argv(2iMoneycharsmax(iMoney));
    
    new 
player cmd_target(idszNameCMDTARGET_ALLOW_SELF CMDTARGET_ONLY_ALIVE CMDTARGET_NO_BOTS);
    
    if(!
player) {
        
console_print(id"Target not found.");
        return 
PLUGIN_HANDLED;
    }
    else {
        if(
cs_set_user_money(playercs_get_user_money(player) + str_to_num(iMoney)))
            
console_print(id"Successfully given.");
    }
    
    return 
PLUGIN_HANDLED;

Torge is offline
GraviAnt
Senior Member
Join Date: Oct 2010
Old 05-25-2014 , 07:06   Re: [PLUGIN NEEDED] amx_givemoney
Reply With Quote #3

Thanks, works perfectly.
GraviAnt 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 16:47.


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