This is how far i got today, be aware, this is just a 2 hour work you're looking at, it won't work yet. Just to show you i'm working on it.
PHP Code:
#include <amxmodx>
#include <colorchat>
#include <basebuilder>
#include <cstrike>
#include <nvault>
#pragma semicolon 1
#if !defined MAX_PLAYERS
const MAX_PLAYERS = 32;
#endif
new const szVersion[] = "1.0.0";
new iVault;
new iMoney[MAX_PLAYERS + 1];
new pExceedLimit;
public plugin_init() {
register_plugin("BankMenu", szVersion, "NapoleoN#");
iVault = nvault_open("BaseBuilderBank");
register_clcmd("say /bank", "ShowBankMenu");
register_clcmd("TakeCashFromBank", "WithdrawMessageModeHandler");
pExceedLimit = register_cvar("bank_limit", "1"); // Change to 0 if u want to be able to withdraw / deposit more than 16k$
}
public plugin_end() {
nvault_close(iVault);
}
#if AMXX_VERSION_NUM < 183
public client_disconnect(id) {
#else
public client_disconnected(id) {
#endif
SaveData(id);
}
public client_authorized(id) {
LoadData(id);
}
public SaveData(id) {
}
public LoadData(id) {
}
public ShowBankMenu(id) {
new szHeader[70];
formatex(szHeader, charsmax(szHeader), "\yBank Menu \r[Protected]^n \yYou have %i$", iMoney[id]);
new iBankMenu = menu_create(szHeader, "BankHandler");
menu_additem(iBankMenu, "\wWithdraw");
menu_additem(iBankMenu, "\wWithdraw All^n");
menu_additem(iBankMenu, "\wDeposit");
menu_additem(iBankMenu, "\wDeposit All^n");
menu_additem(iBankMenu, "\yManage Your Account^n^n");
menu_additem(iBankMenu, "\rDonate Cash^n");
menu_display(id, iBankMenu);
}
public BankHandler(id, iBankMenu, iItem) {
if(is_user_connected(id) && iItem != MENU_EXIT) {
switch(iItem) {
case 0: client_cmd(id, "TakeCashFromBank");
case 1: WithdrawAllCash(id);
case 2: DepositCash(id);
case 3: DepositAllCash(id);
case 4: client_cmd(id, "say /register");
case 5: DonateCash(id);
}
}
menu_destroy(iBankMenu);
}
public WithdrawMessageModeHandler(id) {
new szAmount[9], iAmount; // Max would be 9 999 999 999
read_argv(0, szAmount, charsmax(szAmount));
iAmount = str_to_num(szAmount);
if(iAmount > 16000) {
if(pExceedLimit) {
// +16K$ possible.
}
else {
// Not possible.
}
}
ColorChat(id, GREEN, "Test: szAmount = %i", iAmount);
}
public WithdrawAllCash(id) {
if(iMoney[id] > 16000) {
if(pExceedLimit) {
// Allowed.
}
else {
// Not Allowed.
}
}
}
public DepositCash(id) {
}
public DepositAllCash(id) {
}
public DonateCash(id) {
}
__________________