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

[BB] Bank edit Request


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
crystal xtreme
Member
Join Date: Sep 2021
Location: Pakistan, Karachi.
Old 07-31-2022 , 09:12   [BB] Bank edit Request
Reply With Quote #1

Hi.
I have mentioned bank plugin and i want to edit something in this plugin but i can't edit it can someone help me? I want to add /get command in it. When player write /get command then they automaticly Get 10000$ from bank as gift. And Players claim this gift in every 8 hours. And if player have 100000$ amount in bank then they can't claim this and bank show this message: [Bank] You already have 100000$ in bank!
There is my code:

PHP Code:
#include <amxmodx>
#include <nvault>
#include <cstrike>
#include <colorchat>

new g_vault


public plugin_init() {
    
register_plugin("Bank","3.7","author")
    
    
g_vault nvault_open("BRS")
    
    
register_cvar("brs_warmup","0")
    
register_clcmd("say /banka","Meni")
    
register_clcmd("bb_banka","Meni")
    
register_clcmd("say /bank","Meni")
    
register_clcmd("bb_bank","Meni")
    
register_concmd("deposit","ubaci")
    
register_concmd("withdraw","podigni")
}
public 
Meni(id)
{
    new 
menu menu_create("\d|\rCrystal\d| \WBank Menu","Handler")
    
menu_additem(menu,"Stor Your Money!")
    
menu_additem(menu,"Take Your Money!")
    
menu_additem(menu,"Check Your Balance!")
    
menu_display(idmenu);
}
public 
Handler(id,menu,item)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_CONTINUE;
    }
    switch(
item)
    {
        case 
0:
        {
            
client_cmd(id,"messagemode deposit")
            
ColorChat(0GREEN"^3[Crystal] ^1Type How Much You Need To Save From Your Money!")
        }
        case 
1:
        {
            
client_cmd(id,"messagemode withdraw")
            
ColorChat(0GREEN"^3[Crystal] ^1Type How Much You Need To Take From Your Bank!")
        }
        case 
2:
        {
            new 
broj_bpara[32],pid[32]
            
get_user_authid(id,pid,31)
            
nvault_get(g_vault,pid,broj_bpara,31)
            
ColorChat(0GREEN"^3[Crystal] ^1You Have^3 %s$^1 In Your Bank!",broj_bpara)
        }
    }
    return 
PLUGIN_CONTINUE
}
public 
ubaci(id)
{
    if(
get_cvar_num("brs_warmup")==0)
    {
        new 
suma[32],suma2broj_para
        read_argv
(1,suma,31)
        
suma2 str_to_num(suma)
        
broj_para cs_get_user_money(id)
        if(
suma2<0) return
        if(
suma2>broj_para)
            
ColorChat(0GREEN"^3[Crystal] ^1Impossible for you to put more money in the bank than you have them!")
        else
        {
            new 
pid[32], bmoney[32],bmoney2xxx[32]
            
get_user_authid(id,pid,31)
            
nvault_get(g_vault,pid,bmoney,31)
            
bmoney2 str_to_num(bmoney)
            
num_to_str(suma2+bmoney2,xxx,31)
            
nvault_set(g_vault,pid,xxx)
            
cs_set_user_money(id,broj_para-suma2)
            
ColorChat(0GREEN"^3[Crystal] ^1You Have Just Stored^3 %i$^1 In Your Bank!",suma2)
        }
    }
    else
        
ColorChat(0GREEN"^3[Crystal] ^1You can't put money during heating!")
    
}
public 
podigni(id)
{
    if(
get_cvar_num("brs_warmup")==0)
    {
        new 
suma[32],suma2broj_para,broj_bpara[32],broj_bpara2,pid[32],xxx[32]
        
read_argv(1,suma,31)
        
suma2 str_to_num(suma)
        
broj_para cs_get_user_money(id)
        
get_user_authid(id,pid,31)
        
nvault_get(g_vault,pid,broj_bpara,31)
        
broj_bpara2 str_to_num(broj_bpara)
        if(
suma2<0)
            return
        if(
suma2>broj_bpara2)
            
ColorChat(0GREEN"^3[Crystal] ^1You can't get more money than you have at the bank!")
        else
        {
            if(
suma2+broj_para>16000)
                
ColorChat(0GREEN"^3[Crystal] ^1You Can't Take More^3 16000$")
            else
            {
                
cs_set_user_money(id,broj_para+suma2)
                
num_to_str(broj_bpara2-suma2,xxx,31)
                
nvault_set(g_vault,pid,xxx)
                
ColorChat(0GREEN"^3[Crystal] ^1You has just withdrawn^3 %i$^1 from your bank!",suma2)
            }
        }
    }
    else
        
ColorChat(0GREEN"^3[Crystal] ^1You can't raise steam during heating!")
}
public 
client_putinserver(id)
{
    
set_task(2.0,"clp_delay",id)
}
public 
clp_delay(id)
{
    new 
blaa random_num(0,2)
    switch(
blaa)
    {
        case 
1:
        {
            new 
pid[32], bmoney[32],bmoney2xxx[32]
            
get_user_authid(id,pid,31)
            
nvault_get(g_vault,pid,bmoney,31)
            
bmoney2 str_to_num(bmoney)
            if(
bmoney2<200)
                return 
PLUGIN_CONTINUE
            
else
            {
                
num_to_str(bmoney2-200,xxx,31)
                
nvault_set(g_vault,pid,xxx)
                
ColorChat(0GREEN"^3[Crystal] ^1Dinkic stole^3 200$ from the bank!")
            }
        }
        case 
2:
        {
            new 
pid[32], bmoney[32],bmoney2xxx[32]
            
get_user_authid(id,pid,31)
            
nvault_get(g_vault,pid,bmoney,31)
            
bmoney2 str_to_num(bmoney)
            
num_to_str(bmoney2+100,xxx,31)
            
nvault_set(g_vault,pid,xxx)
            
ColorChat(0GREEN"^3[Crystal] ^1The bank gives you^3 100$^1 as a gift!")
        }
        case 
3:
        {
            
ColorChat(0GREEN"^3[Crystal] ^1The money in your account has^3 not changed!")
        }
    }
    return 
PLUGIN_CONTINUE

crystal xtreme is offline
crystal xtreme
Member
Join Date: Sep 2021
Location: Pakistan, Karachi.
Old 08-01-2022 , 12:34   Re: [BB] Bank edit Request
Reply With Quote #2

..................
crystal xtreme is offline
Uzviseni Bog
Senior Member
Join Date: Jun 2020
Old 08-29-2022 , 13:11   Re: [BB] Bank edit Request
Reply With Quote #3

https://forums.alliedmods.net/showthread.php?t=252308
Uzviseni Bog is offline
crystal xtreme
Member
Join Date: Sep 2021
Location: Pakistan, Karachi.
Old 08-30-2022 , 03:00   Re: [BB] Bank edit Request
Reply With Quote #4

Quote:
Originally Posted by Uzviseni Bog View Post
Can you change it to for all like how i mentioned on thread.
When any player wrote /get Than he get 10000$ And players can use this command in every 6Hours.And if player already have 100000$ in bank than he can't get 10000$.
I also attached my bank plugin in my thread and also all details that what i need in plugin ( Iam using BaseBuilder 6.5 Version ): https://forums.alliedmods.net/showpo...71&postcount=1


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

#define PLUGIN "All Money"
#define VERSION "1.6"
#define AUTHOR "Abhishek Deshkar"

static  Money 16000
static rounds 0
static roundAfterMoney

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /allmoney" ,"cmDgiveMoneyToAll",ADMIN_KICK,"Give Money to All")
    
register_logevent"logevent_roundstart"2"1=Round_Start" )
    
roundAfterMoney register_cvar("RoundMoney""3")  //set rounds
    

}

public 
cmDgiveMoneyToAll()
{
    if(
rounds==roundAfterMoney)
    {
        new 
players[32], playerCountiplayer
        get_players
(players,playerCount,"a");
        for(
i=0;i<playerCount;i++)
        {
            
player players[i];
            
                
cs_set_user_money(playerMoney)
                
            
        } 
    }
    else
    {
        
server_print("After 3 rounds only")
    }
}

public 
logevent_roundstart(id)
{
    if(
rounds>roundAfterMoney)
    {
    
        
rounds 0
    
}
    else
    {
        
rounds rounds 1
    
}


Last edited by crystal xtreme; 08-30-2022 at 03:05.
crystal xtreme 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 19:47.


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