Raised This Month: $99 Target: $400
 24% 

Money System [Bank | Donate | Give | Take | Time presents]


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   General Purpose       
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 09-05-2020 , 13:50   Money System [Bank | Donate | Give | Take | Time presents]
Reply With Quote #1

Money System 1.6
Release: September, 05, 2020 | Last Update: October, 10, 2020


Table of Contents

Description top

With this plugin you have many features for those servers are using money system:
  • Bank System(Save, Take, Donate, Reset, Check).
  • Give/Take money.
  • Donate (Trading money from players to other players).
  • Time presents (Getting reward for being active in server).

1.Bank System features:
  • Deposit (Save Cash).
  • Deposit All (Save All Cash).
  • Withdraw (Take Cash).
  • Withdraw All (Take All Cash).
  • Check Your Money (Check how much cash do you have in your bank).
  • Donate Money (Trading money from player bank to player bank).
  • Reset Bank (Opens a Menu That Shows online players "Name (User Money)" for reset bank, access (ADMIN_RCON)).

2.Give/Take money features:
  • Give money to specified player.
  • Take money from specified player.

3.Donate features:
  • This is different about that other option in bank system this for trading money from players to other players and the other one for trading money from player bank to player bank.

4.Time presents features:
  • Give players something for staying active on server.
Images top
Spoiler


Installation top

To install the plugin:
  1. Download the zip file..
  2. Put MoneySystem.txt in cstrike/addons/amxmodx/data/lang
  3. Put MoneySystem.cfg in cstrike/addons/amxmodx/confings
  4. Open addons/amxmodx/configs/plugins.ini and add at the end of this file MoneySystem.amxx
  5. Restart the server/change map.

To compile locally:
Cvars top
  • ms_bank: Enable / Disable Bank system. Default 1
  • ms_time_presents: Enable / Disable Time Present. Default 1
  • ms_give_money: Enable / Disable Give Money. Default 1
  • ms_take_money: Enable / Disable Take Money. Default 1
  • ms_donate_money: Enable / Disable Donate system. Default 1
  • ms_bank_cashlimit: To withdraw / deposit more than 16k$. Default 1
  • ms_max_cash: Max cash for withdraw all / deposit all. Default 16000
  • ms_max_bank_cash: Max cash can save in bank. Default 100000000
  • ms_three_min: Bonus of 3 minutes activity on server. Default 1000
  • ms_five_min: Bonus of 5 minutes activity on server. Default 2000
  • ms_ten_min: Bonus of 10 minutes activity on server. Default 3000
  • ms_fivteen_min: Bonus of 15 minutes activity on server. Default 4000
  • ms_twenty_min: Bonus of 20 minutes activity on server. Default 5000
Access's top
Spoiler


Credits top
Using this plugin with other currencies top

The plugin also has the option to use native plugins in place of money. In simple words - you can make this plugin work with Ammo Packs, BaseBuilder Credits, JBPacks and more. To do this, you need to edit the following lines (15/16):
Spoiler


ChangeLog top
  • V 1.0 (September, 05,2020 ):
    • Initial release.
  • V 1.1 (September, 09,2020 ):
    • Fixed some codes.
    • Added bank system.
    • Added doante money from bank to bank.
  • V 1.2 (September, 10,2020 ):
    • Added time presents.
  • V 1.3 (September, 10,2020 ):
    • Edited Codes to use native plugins in place of money, You can make this plugin work with Ammo Packs, BaseBuilder Credits, JBPacks and Other's.
  • V 1.4 (September, 14,2020 ):
    • Fixed Some codes.
    • Added Lang file.
    • Added CFG file.
    • Transformed define's to cvar's
  • V 1.5 (September, 16,2020 ):
    • Edited Some codes.
  • V 1.6 (October, 10,2020 ):
    • Code cleaned.
    • New cvar's for enable/disable options.
    • Used CromChat.
Downloads top
  • 1.6 version:
  • Need to download CromChat API file to compile this plugin.
Attached Files
File Type: zip MoneySystem.zip (19.5 KB, 19 views)

Last edited by Supremache; 10-17-2020 at 11:55. Reason: Edited New Updates v1.6
Supremache is offline
HowToRuski
Member
Join Date: Feb 2019
Location: Latvia
Old 09-05-2020 , 14:29   Re: Money System [Donate | Give | Take]
Reply With Quote #2

Thanks, works great
HowToRuski is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 09-05-2020 , 14:41   Re: Money System [Donate | Give | Take]
Reply With Quote #3

Quote:
Originally Posted by HowToRuski View Post
Thanks, works great
Enjoy, I will try to add bank system to this plugin when i do new updates
Supremache is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 09-05-2020 , 16:09   Re: Money System [Donate | Give | Take]
Reply With Quote #4

Some optimization:
1.
Code:
client_print(id, print_console
-->>
console_print()
Code:
sizeof() -1 ???
->>
charsmax()
Code:
format(filename, sizeof(filename) - 1, "%s/MoneySystem_%s.log", dir, filename); -->> static log_file[64]; formatex(log_file, charsmax(log_file), "%s/MoneySystem_%s.log", dir, filename); /* Much faster than what format() can do */ log_to_file(log_file, "%s", message);

stock ChatColor /* ???? client_print_color() */

And you can get the name of player in a global var ( or a hash map ). When he's connecting you retrive his name and use it instead of this:
Code:
get_user_name( id, ... )
get_user_name( iTarget, ... )
Same thing with the steamid
__________________

Last edited by Shadows Adi; 09-05-2020 at 16:09.
Shadows Adi is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 09-05-2020 , 16:53   Re: Money System [Donate | Give | Take]
Reply With Quote #5

Quote:
Originally Posted by Shadows Adi View Post
Some optimization:
1.
Code:
client_print(id, print_console
-->>
console_print()
Code:
sizeof() -1 ???
->>
charsmax()
Code:
format(filename, sizeof(filename) - 1, "%s/MoneySystem_%s.log", dir, filename); -->> static log_file[64]; formatex(log_file, charsmax(log_file), "%s/MoneySystem_%s.log", dir, filename); /* Much faster than what format() can do */ log_to_file(log_file, "%s", message);

stock ChatColor /* ???? client_print_color() */

And you can get the name of player in a global var ( or a hash map ). When he's connecting you retrive his name and use it instead of this:
Code:
get_user_name( id, ... )
get_user_name( iTarget, ... )
Same thing with the steamid
Thx i understand you, But client_print_color() working only for amxmodx 1.8.3 so i can't use it because i want my plugin working on all versions and thanks and again i will edit all that when i add new updates

Last edited by Supremache; 09-05-2020 at 17:11.
Supremache is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-06-2020 , 21:10   Re: Money System [Donate | Give | Take]
Reply With Quote #6

Quote:
Originally Posted by Supremache View Post
Thx i understand you, But client_print_color() working only for amxmodx 1.8.3 so i can't use it because i want my plugin working on all versions and thanks and again i will edit all that when i add new updates
He never mentioned client_print_color
__________________
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 09-07-2020 , 08:06   Re: Money System [Donate | Give | Take]
Reply With Quote #7

Quote:
Originally Posted by Natsheh View Post
He never mentioned client_print_color
Check it again, i think he mean, why i used stock chatcolor and there's client_print_color for amxmodx

Quote:
stock ChatColor /* ???? client_print_color() */
Supremache is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 09-08-2020 , 10:57   Re: Money System [Donate | Give | Take]
Reply With Quote #8

Using amx 1.9> you can do something like:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
 
#define PLUGIN "Money Donate"
#define VERSION "1.0"
#define AUTOR "iceeedR"

new const Prefix[] = "Allied Donators"
new DonateTarget[MAX_PLAYERS +1]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTOR);
    
register_clcmd("say /donate""DonateCmd")
    
register_clcmd("plugin_donate""DonateHandler")
}
 
public 
client_disconnected(id)
{
    
DonateTarget[id] = -// just for secure
}

public 
client_putinserver(id)
{
    
DonateTarget[id] = -// just for secure
}

public 
DonateCmd(id)
{
    new 
iMenu menu_create(fmt("\y[\w%s\d - \rDonate Menu \y ]"Prefix), "donate_handler")

    new 
iPlayers[MAX_PLAYERS], iNum
    get_players_ex
(iPlayersiNumGetPlayers_MatchTeam, (cs_get_user_team(id) == CS_TEAM_T) ? "TERRORIST" "CT")
    for(new 
iszTempid[10], iPlayer;iNum;i++)
    {
        
iPlayer iPlayers[i]

        if(
iPlayer != id)
        {
            
num_to_str(iPlayerszTempidcharsmax(szTempid))

            
menu_additem(iMenufmt("%n"iPlayer), szTempid)
        }
    }
    
    
menu_display(idiMenu)
    return 
PLUGIN_HANDLED
}

public 
donate_handler(idiMenuiItem)
{
    if(
iItem == MENU_EXIT)
    {
        
menu_destroy(iMenu)
        return 
PLUGIN_HANDLED
    
}
    new 
iData[6], szItemName[MAX_PLAYERS 2], iAccessiCallback
    menu_item_getinfo
(iMenuiItemiAccessiDatacharsmax(iData), szItemNamecharsmax(szItemName), iCallback)
    
    
DonateTarget[id] = str_to_num(iData)
    
    if(!
DonateTarget[id])
    {
        
client_print_color(idprint_team_default"%s This player does not exist."Prefix)
        
menu_display(idiMenu)
        
DonateTarget[id] = -1
        
return PLUGIN_HANDLED
    
}
    
    
client_cmd(id"messagemode plugin_donate")
            
    
client_print_color(idprint_team_default"%s Type how much you want to give."Prefix)
    return 
PLUGIN_HANDLED
}

public 
DonateHandler(id)
{
    new 
iValue read_argv_int(1)
        
    new 
iPlayerMoney cs_get_user_money(id)
    
    if( 
iPlayerMoney iValue || iValue <= 0)
    {
        
client_print_color(idprint_team_default"%s You do not have enough money or invalid value."Prefix)
        return 
PLUGIN_CONTINUE
    
}
    
    
cs_set_user_moneyDonateTarget[id], cs_get_user_money(DonateTarget[id]) + iValue)
    
cs_set_user_moneyidcs_get_user_money(id) - iValue)
    
    new 
iPlayers[MAX_PLAYERS], iNum
    get_players_ex
(iPlayersiNumGetPlayers_MatchTeam, (cs_get_user_team(id) == CS_TEAM_T) ? "TERRORIST" "CT")
    for(new 
i;iNum;i++)
    {
        
client_print_color(iPlayers[i], print_team_default"%s^x04 %n^x01 donated^x04 $%i^x01 for^x04 %n."PrefixidiValueDonateTarget[id])
    }
    
client_cmd(DonateTarget[id], "spk ^"items/9mmclip1.wav^"")
    
    
DonateTarget[id] = -1
    
return PLUGIN_HANDLED

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
iceeedr is offline
Send a message via Skype™ to iceeedr
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 09-08-2020 , 16:23   Re: Money System [Donate | Give | Take]
Reply With Quote #9

Quote:
Originally Posted by iceeedr View Post
Using amx 1.9> you can do something like:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
 
#define PLUGIN "Money Donate"
#define VERSION "1.0"
#define AUTOR "iceeedR"

new const Prefix[] = "Allied Donators"
new DonateTarget[MAX_PLAYERS +1]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTOR);
    
register_clcmd("say /donate""DonateCmd")
    
register_clcmd("plugin_donate""DonateHandler")
}
 
public 
client_disconnected(id)
{
    
DonateTarget[id] = -// just for secure
}

public 
client_putinserver(id)
{
    
DonateTarget[id] = -// just for secure
}

public 
DonateCmd(id)
{
    new 
iMenu menu_create(fmt("\y[\w%s\d - \rDonate Menu \y ]"Prefix), "donate_handler")

    new 
iPlayers[MAX_PLAYERS], iNum
    get_players_ex
(iPlayersiNumGetPlayers_MatchTeam, (cs_get_user_team(id) == CS_TEAM_T) ? "TERRORIST" "CT")
    for(new 
iszTempid[10], iPlayer;iNum;i++)
    {
        
iPlayer iPlayers[i]

        if(
iPlayer != id)
        {
            
num_to_str(iPlayerszTempidcharsmax(szTempid))

            
menu_additem(iMenufmt("%n"iPlayer), szTempid)
        }
    }
    
    
menu_display(idiMenu)
    return 
PLUGIN_HANDLED
}

public 
donate_handler(idiMenuiItem)
{
    if(
iItem == MENU_EXIT)
    {
        
menu_destroy(iMenu)
        return 
PLUGIN_HANDLED
    
}
    new 
iData[6], szItemName[MAX_PLAYERS 2], iAccessiCallback
    menu_item_getinfo
(iMenuiItemiAccessiDatacharsmax(iData), szItemNamecharsmax(szItemName), iCallback)
    
    
DonateTarget[id] = str_to_num(iData)
    
    if(!
DonateTarget[id])
    {
        
client_print_color(idprint_team_default"%s This player does not exist."Prefix)
        
menu_display(idiMenu)
        
DonateTarget[id] = -1
        
return PLUGIN_HANDLED
    
}
    
    
client_cmd(id"messagemode plugin_donate")
            
    
client_print_color(idprint_team_default"%s Type how much you want to give."Prefix)
    return 
PLUGIN_HANDLED
}

public 
DonateHandler(id)
{
    new 
iValue read_argv_int(1)
        
    new 
iPlayerMoney cs_get_user_money(id)
    
    if( 
iPlayerMoney iValue || iValue <= 0)
    {
        
client_print_color(idprint_team_default"%s You do not have enough money or invalid value."Prefix)
        return 
PLUGIN_CONTINUE
    
}
    
    
cs_set_user_moneyDonateTarget[id], cs_get_user_money(DonateTarget[id]) + iValue)
    
cs_set_user_moneyidcs_get_user_money(id) - iValue)
    
    new 
iPlayers[MAX_PLAYERS], iNum
    get_players_ex
(iPlayersiNumGetPlayers_MatchTeam, (cs_get_user_team(id) == CS_TEAM_T) ? "TERRORIST" "CT")
    for(new 
i;iNum;i++)
    {
        
client_print_color(iPlayers[i], print_team_default"%s^x04 %n^x01 donated^x04 $%i^x01 for^x04 %n."PrefixidiValueDonateTarget[id])
    }
    
client_cmd(DonateTarget[id], "spk ^"items/9mmclip1.wav^"")
    
    
DonateTarget[id] = -1
    
return PLUGIN_HANDLED

I can do the same but with amxmodx 1.8.x , i want my plugin working on any versions

Last edited by Supremache; 09-08-2020 at 16:43.
Supremache is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 09-08-2020 , 17:54   Re: Money System [Donate | Give | Take]
Reply With Quote #10

Quote:
Originally Posted by Supremache View Post
I can do the same but with amxmodx 1.8.x , i want my plugin working on any versions
At no time did I say otherwise, I just left a version for amx 1.9 in case anyone wants to, if you want I delete it.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
iceeedr is offline
Send a message via Skype™ to iceeedr
Reply


Thread Tools
Display Modes

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:39.


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