Raised This Month: $ Target: $400
 0% 

BB Bank Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   General Purpose       
Houssam Benmouna
Senior Member
Join Date: Apr 2016
Old 06-04-2016 , 15:00   BB Bank Menu
Reply With Quote #1

hi all I want to share This plugins with you

This plugin created by someone (anonyme ) and fixed by me

this plugin like "bank system" in zp but this used in base builder Mod

PHP Code:
#include <amxmodx>   
#include <amxmisc>   
#include <cstrike>   
#include <hamsandwich>   
#include <basebuilder>   
#include <fun>   
#include < ColorChat > 
#include < fvault >    

#pragma dynamic 32768    
#define is_valid_player(%1) (1 <= %1 <= 32)    

///////#define STEAM     
#define NICK     
///////#define IP     

new g_AP[33]   
new 
g_DonateID[33]  

native bb_get_user_ammo_packs(id)
native bb_set_user_ammo_packs(idamount

public 
plugin_init()   
{   
    
register_plugin("Bank Menu","2.1","Fixed By PlayBoy")   

    
register_clcmd("takeAmount""cmdTakeAmount")   
    
register_clcmd("saveAmount""cmdSaveAmount")   
    
register_clcmd("donate","menuDonate")  
    
register_clcmd("say donate""menuDonate")   
    
register_clcmd("say /donate""menuDonate")   

       
    
register_clcmd("say /bank""PlayBoyBank")   
    
register_clcmd("say bank""PlayBoyBank")   
    
register_clcmd("say_team /bank""PlayBoyBank")   
       
}   

public 
PlayBoyBank(id)   
{       
    if(
is_valid_player(id))   
    {   
        new 
title[100]   
        
formatex(title99"\yBank Menu \r[Protected] ^n \yYou have %i Ammo packs"g_AP[id])   
           
           
        new 
bankMenu menu_create(title"menuBankHandler")   
           
        
menu_additem(bankMenu"\wWithdraw""1")   
        
menu_additem(bankMenu"\wWithdraw All^n""2")   
           
        
menu_additem(bankMenu"\wDeposit""3")   
        
menu_additem(bankMenu"\wDeposit All^n""4")   
           
        
menu_additem(bankMenu"\yManage Your Account^n^n""5")

        
menu_additem(bankMenu"\rTransfer Ammo Packs^n""6")   
      
        
menu_display(idbankMenu0)   
    }   
    return 
PLUGIN_HANDLED;   
}   

public 
menuBankHandler(idmenuitem)   
{           
    new 
data[6], iName[64], accesscallback   
    menu_item_getinfo
(menuitemaccessdata5iName63callback)   
       
    new 
key str_to_num(data)   
       
    switch(
key)   
    {   
        case 
1:   
        {   
            
client_cmd(id"messagemode takeAmount")   
        }   
        case 
2:   
        {   
            
cmdTakeAll(id)   
        }   
        case 
3:   
        {   
            
client_cmd(id"messagemode saveAmount")   
        }   
        case 
4:   
        {   
            
cmdSaveAll(id)   
        }   
        case 
5:   
        {   
            
client_cmd (id"say /register")
        }
        case 
6:
        {
            
menuDonate(id)
        }   
    }   
}   

public 
cmdTakeAmount(id)   
{   
    new 
szAps[11]   
    
read_args(szAps10)   
    
remove_quotes(szAps)   
       
    if(
equal(szAps"") || equal(szAps" "))   
        return 
PLUGIN_HANDLED   
       
    
new iAps str_to_num(szAps)   
       
    if(
iAps 1) return PLUGIN_HANDLED   
       
    
new iApsSum iAps bb_get_user_ammo_packs(id)   
       
    if(
iAps <= g_AP[id] && iApsSum <= 999)   
    {   
        
bb_set_user_ammo_packs(idiApsSum)   
        
g_AP[id] -= iAps   
           
        ColorChat
(0RED"^3[G#D] ^1You Took ^3%i ^1Ammopacks From Your Bank. Now You Have ^3%i ^1Ammopacks In Your Bank."iApsg_AP[id])   
           
        return 
PLUGIN_CONTINUE   
    
}   
    else   
    {   
        
ColorChat(0RED"^3[G#D] ^1You Dont Have Enough Ammopacks Or You Wanted To Take Too Much Ammopacks.")   
    }   
       
    return 
PLUGIN_CONTINUE   
}   

public 
cmdTakeAll(id)   
{   
    new 
iApsSum bb_get_user_ammo_packs(id) + g_AP[id]   
       
    if(
iApsSum <= 999)   
    {   
        
bb_set_user_ammo_packs(idiApsSum)   
           
        
ColorChat(0RED"^3[G#D] ^1You Took All ^3%i ^1Ammopacks From Your Bank."g_AP[id])   
           
        
g_AP[id] = 0   
    
}   
    else if(
iApsSum 999)   
    {   
        new 
giveAps 999 bb_get_user_ammo_packs(id)   
           
        if(
giveAps <= g_AP[id])   
        {   
            
bb_set_user_ammo_packs(idgiveAps bb_get_user_ammo_packs(id))   
            
g_AP[id] -= giveAps   
               
            ColorChat
(0RED"^3[G#D] ^1You Took ^3%i ^1Ammopacks From Your Bank. Now You Have %i Ammopacks In Your Bank."giveApsg_AP[id])   
        }   
    }   
}   

public 
cmdSaveAmount(id)   
{   
    new 
szAps[11]   
    
read_args(szAps10)   
    
remove_quotes(szAps)   
       
    if(
equal(szAps"") || equal(szAps" "))   
        return 
PLUGIN_HANDLED   
       
    
new iAps str_to_num(szAps)   
       
    if(
iAps 1) return PLUGIN_HANDLED   
       
    
new haveAps bb_get_user_ammo_packs(id)   
       
    if(
iAps <= haveAps)   
    {   
        
bb_set_user_ammo_packs(idhaveAps iAps)   
        
g_AP[id] += iAps   
           
        ColorChat
(0RED"^3[G#D] ^1You Saved ^3%i Ammopacks In Your Bank. Now You Have ^3%i ^1Ammopacks In Your Bank."iApsg_AP[id])   
    }   
    else   
    {   
        
ColorChat(0RED"^3[G#D] ^1You Dont Have Enough Ammopacks")   
    }   
       
    return 
PLUGIN_CONTINUE   
}   

public 
cmdSaveAll(id)   
{   
    new 
haveAps bb_get_user_ammo_packs(id)   
       
    
bb_set_user_ammo_packs(id0)   
    
g_AP[id] += haveAps   
       
    ColorChat
(0RED"^3[G#D] ^1You Saved ^3%i ^1Ammopacks To Your Bank. Now You Have ^3%i ^1Ammopacks In Your Bank."haveApsg_AP[id])   
}   

public 
menuDonate(id)   
{   
    new 
DonateMenu menu_create("\r[G#D] \wChoose A Player To Donate:""menuDonateHandler")   
       
    new 
players[32], pnumtempid   
       
    
new szName[32], szTempid[10]   
       
    
get_players(playerspnum)   
       
    for( new 
ii<pnumi++ )   
    {   
        
tempid players[i]   
           
        if(
id != tempid)   
        {   
            
get_user_name(tempidszName31)   
            
num_to_str(tempidszTempid9)   
               
            
menu_additem(DonateMenuszNameszTempid0)   
        }   
    }   
       
    
menu_display(idDonateMenu0)   
}   

public 
menuDonateHandler(idmenuitem)   
{       
    new 
data[6], iName[64];   
    new 
accesscallback;   
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);   
       
    new 
tempid str_to_num(data);   
       
    
g_DonateID[id] = tempid   
       
    client_cmd
(id"messagemode donate")   
       
    
menu_destroy(menu);   
    return 
PLUGIN_HANDLED;   
}   

public 
cmdDonate(id)   
{   
    if(
g_DonateID[id] == 0) return PLUGIN_HANDLED   
       
    
new szAps[11]   
    
read_args(szAps10)   
    
remove_quotes(szAps)   

       
    new 
iAps str_to_num(szAps)   
       
    if(
iAps 1) return PLUGIN_HANDLED   
       
    
if(iAps <= g_AP[id])   
    {   
        
// Take iAps away   
        
g_AP[id] -= iAps   
           
        
new NameDonate[45]   
        
get_user_name(g_DonateID[id], NameDonate44)   
        new 
Name[45]   
        
get_user_name(g_DonateID[id], Name44)   
           
        
ColorChat(0RED"^3[G#D] ^1You Donated ^3%i ^1Ammopacks To ^3%s^1. Now You Have %i ammopacks In Your Bank."iApsNameDonateg_AP[id])   
           
        
// give iAps to Donateid   
        
g_AP[g_DonateID[id]] += iAps   
        ColorChat
(g_DonateID[id], RED"^3[G#D] ^3%s ^1Donated ^3%i ^1Ammopacks To You. Now You Have ^3%i ^1Ammopacks In Your Bank."NameiApsg_AP[g_DonateID[id]])   
    }   
    else   
    {   
        
ColorChat(0RED"^3[G#D] ^1You Dont Have Enough Ammopacks")   
    }   
       
    return 
PLUGIN_CONTINUE   
}   

public 
SaveData(id)     
{     
    new 
szMethod65 ];    
        
    
#if defined STEAM    
    
get_user_authididszMethod34 );    
    
#endif    
        
    #if defined NICK    
    
get_user_nameidszMethod34 );    
    
#endif    
        
    #if defined IP    
    
get_user_ipidszMethod34);    
    
#endif    
        
    
new vaultkey[64], vaultdata[328];     
    
format(vaultkey63"bb_%s"szMethod);     
    
format(vaultdata327"%i"g_AP[id]);     
        
    
fvault_set_data"bbVault"vaultkeyvaultdata );    
}     

// Load data function     
public LoadData(id)     
{     
    new 
szMethod65 ];    
        
    
#if defined STEAM    
    
get_user_authididszMethod34 );    
    
#endif    
        
    #if defined NICK    
    
get_user_nameidszMethod34 );    
    
#endif    
        
    #if defined IP    
    
get_user_ipidszMethod34);    
    
#endif    
        
    
new vaultkey[64], vaultdata[328];     
    
format(vaultkey63"bb_%s"szMethod);     
    
format(vaultdata327"%i"g_AP[id]);     
        
    
fvault_get_data"bbVault"vaultkeyvaultdatacharsmaxvaultdata ) );    
        
    
g_APid ] = str_to_numvaultdata );    
}     
// When client enter on server     
public client_putinserver(id)     
{     
    
LoadData(id);     
}     

// When client disconnect     
public client_disconnect(id)     
{     
    
SaveData(id);     

Attached Files
File Type: sma Get Plugin or Get Source (G#D_bank_system.sma - 1488 views - 9.2 KB)
File Type: inc basebuilder.inc (9.4 KB, 467 views)

Last edited by Houssam Benmouna; 06-04-2016 at 15:10. Reason: attach basebuilder.inc
Houssam Benmouna is offline
4EtThhG
New Member
Join Date: Jun 2016
Old 06-04-2016 , 15:17   Re: BB Bank Menu
Reply With Quote #2

GooD Job bro

it's working
4EtThhG is offline
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 06-05-2016 , 12:42   Re: BB Bank Menu
Reply With Quote #3

Please add description and its commands and function s etc etc ...
tousif is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-07-2016 , 03:48   Re: BB Bank Menu
Reply With Quote #4

1) Description
2) Credits for the person who actually created this plugin and his approval to edit and publish your customized plugin.
3) Eventually the source of the original plugin so people can see what you actually "changed" in the plugin.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-19-2016 , 10:40   Re: BB Bank Menu
Reply With Quote #5

Quote:
2) Credits for the person who actually created this plugin and his approval to edit and publish your customized plugin.
Credits are requiered, but not the approval. As long as you have the source you can do anything you want with it.

Unapproved, we have a lot of bank plugins around here and they are better coded.
__________________
HamletEagle is offline
Amine Belokda
Senior Member
Join Date: Oct 2015
Location: ML_NOT_FOUND
Old 06-20-2016 , 23:04   Re: BB Bank Menu
Reply With Quote #6

This Plugin Created By: Drissdev1 And Thanks
HELP: This Plugin No Bug To Fixed
__________________
Amine Belokda is offline
Send a message via MSN to Amine Belokda
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-22-2016 , 11:51   Re: BB Bank Menu
Reply With Quote #7

You shouldn't hardcode everything in your code, use charsmax instead. It's easier to use if you're editing the array later on.
example:
PHP Code:
new title[100]   
formatex(title99"\yBank Menu \r[Protected] ^n \yYou have %i Ammo packs"g_AP[id]) 
-->
PHP Code:

new title[100]   
formatex(titlecharsmax(title), "\yBank Menu \r[Protected] ^n \yYou have %i Ammo packs"g_AP[id]) 
</span></span>
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 06-22-2016 , 16:01   Re: BB Bank Menu
Reply With Quote #8

It will not affect the plugin, @Napoleon_be, and this plugin has been unapproved, dont give suggestions.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-22-2016 , 16:35   Re: BB Bank Menu
Reply With Quote #9

Quote:
Originally Posted by EFFx View Post
It will not affect the plugin, @Napoleon_be, and this plugin has been unapproved, dont give suggestions.
What does it even matter lol haha, it's for his own good that he knows how to improve his code in the future. Nothing wrong with suggestions imo if they're correct. My plugins have been unapproved aswel and people have been giving suggestions aswell.

It will indeed not affect the plugin, but it will affect the difficulty and time in changing and editting the plugin.
__________________

Last edited by Napoleon_be; 06-22-2016 at 16:37.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-22-2016 , 16:42   Re: BB Bank Menu
Reply With Quote #10

Quote:
Originally Posted by EFFx View Post
It will not affect the plugin, @Napoleon_be, and this plugin has been unapproved, dont give suggestions.
You are wrong. If someone is kind enough to help him, that's perfect. Also not hardcoding stuff is a must.
__________________
HamletEagle 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 15:54.


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