Raised This Month: $248 Target: $400
 62% 

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

MoneySystemv1.5






.: Description :.

- This plugin for those server are using money system will help them alot.

.: Modules :.

- CStrike
- Nvault

.: Cvars & Commands :.

- The cvars are located on the MoneySystem.cfg.

- amx_givem <player> give money to specified player
- amx_takem <player> take money from specified player
- say /donate <player> <bouns> trade money from player to player
- say /bank Bank menu
- ms_prefix "[MoneySystem]" ; - Messages Prefix (Default: [MoneySystem])
- ms_donate_money "1" ; - 1/0 - Enable / Disable Donate system (Default: 1)
- ms_bank_cashlimit "1" ; - 1/0 - to withdraw / deposit more than 16k$ (Default:1)
- ms_max_cash "16000" ; - Max money to withdraw all / deposit all (Default: 16000)
- ms_max_bank_cash "100000000" ; - Max money can saved in bank (Default: 100000000)
- ms_three_min "1000" ; - Bonus of 3 minutes activity on server (Default: 1000)
- ms_five_min "2000" ; - Bonus of 5 minutes activity on server (Default: 2000)
- ms_ten_min "3000" ; - Bonus of 10 minutes activity on server (Default: 3000)
- ms_fivteen_min "4000" ; - Bonus of 15 minutes activity on server (Default: 4000)
- ms_twenty_min "5000" ; - Bonus of 20 minutes activity on server (Default: 5000)


.: Access's :.

Code:
#define FLAGS_GIVE ADMIN_KICK       // Flag give money
#define FLAGS_TAKE ADMIN_KICK       // Flag take money
#define FLAGS_RESET_BANK ADMIN_RCON       // Flag reset bank
.: Installation :.

- Download the zip file.
- Place the plugin in the plugins folder
- Add "MoneySystem.txt" to the cstrike/addons/amxmodx/data/lang folder
- Add "MoneySystem.cfg" to the cstrike/addons/amxmodx/confings folder
- Add the "MoneySystem" to the cstrike/addons/amxmodx/plugins folder
- Add "MoneySystem.amxx" in the cstrike/addons/amxmodx/confings/plugins.ini (without the "")
- Restart your server and enjoy!

.: Additional Information :.

- This plugin can work on all AMXx versions
- Deposit // Save money
- Deposit All // Save all money
- Withdraw // Take money
- Withdraw All // Take all money
- Check Your Money // Check how much u 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 for user (ADMIN_RCON)

P.s: say/donate is different, it's for trading money from player to player and the another one for trading money from player bank to player bank

.: Credits :.

- Supremache - Designer of this plugin

.: Using currency from another plugin / mod :.

- The plugin also has the option to use native 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 (23/24)

Code:
#define get_user_money(%1) cs_get_user_money(%1)
#define set_user_money(%1,%2) cs_set_user_money(%1, %2)
- To change it to Ammo Packs, replace the rows with this:

Code:
#define get_user_money(%1) zp_get_user_ammo_packs(%1)
#define set_user_money(%1,%2) zp_set_user_ammo_packs(%1, %2)
- Also, add the natives you use in both rows:

Code:
native zp_get_user_ammo_packs(id)
native zp_set_user_ammo_packs(id, amount)
- Or .inc file:

Code:
#include <zombieplague>
.: Changelog :.

Quote:
Code:
	Changelog:
		 Version: 1.0 beta (September, 05,2020 )
			Initial beta release.
		 Version: 1.1 New Updates (September, 09,2020 )
			Fixed some codes.
			Added bank system.
			Added doante money from bank to bank.
		 Version: 1.2 New Updates (September, 10,2020 )
			Added time presents.
		 Version: 1.3 New Updates (September, 10,2020 )
			Edited Codes to use native native plugins in place of money,
			You can make this plugin work with Ammo Packs, BaseBuilder Credits, JBPacks and Other's
		 Version: 1.4 New Updates (September, 14,2020 )
			Fixed Some codes.
			Added Lang file.
			Added CFG file.
			Transformed define's to cvar's
		 Version: 1.5 New Updates (September, 16,2020 )
			Edited Some codes.
Attached Files
File Type: zip MoneySystem.zip (18.4 KB, 7 views)

Last edited by Supremache; 09-16-2020 at 15:30. Reason: Edited New Updates v1.5
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 online now
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 online now
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 09:45.


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