Simple help
#1

PHP код:
CMD:savecash(playeridparams[])
{
    if (
playeritems[playerid][ITEM_TYPE_Breifcase] == 0) return SendClientMessage2(playeridCOLOR_RED"You don't have a breifcase buy it from nearest store!");
    new 
cash;
    if(
sscanf(params"d"cash)) return SendClientMessage(playeridCOLOR_WHITE"Usage: /savecash [Amount]");
    new 
pcash GetPlayerMoney(playerid);
    if(
pcash cash) return SendClientMessage(playeridCOLOR_RED"Error: You don't have that amount!");
    new 
name[26];
    
GetPlayerName(playeridname26);
    
dini_IntSet(AddDirFile(dir_userfilesname), "Briefcasecash"cash);
    
GivePlayerMoney(playerid, -cash);
    new 
string[256];
    
format(stringsizeof(string), "You have deposited %d from your briefcase. You have now %d"cashdini_Int(AddDirFile(dir_userfilesname), "Briefcasecash"));
    
SendClientMessage(playeridCOLOR_YELLOWstring);
    return 
1;
}
CMD:getbccash(playeridparams[])
{
    if (
playeritems[playerid][ITEM_TYPE_Breifcase] == 0) return SendClientMessage2(playeridCOLOR_RED"You don't have a breifcase buy it from nearest store!");
    new 
cash;
    new 
name[MAX_PLAYER_NAME];
    if(
sscanf(params"d"cash)) return SendClientMessage(playeridCOLOR_WHITE"Usage: /getcash [Amount]");
    if(
dini_Int(AddDirFile(dir_userfilesname), "Briefcasecash") < cash) return SendClientMessage(playeridCOLOR_RED"Error: You don't have that amount!");
    
dini_IntSet(AddDirFile(dir_userfilesname), "Briefcasecash"dini_Int(AddDirFile(dir_userfilesname), "Briefcasecash") - cash);
    
GivePlayerMoney(playeridcash);
    new 
string[256];
    
format(stringsizeof(string), "You have Withdrawn %d from your briefcase. You have now %d"cashdini_Int(AddDirFile(dir_userfilesname), "Briefcasecash"));
    
SendClientMessage(playeridCOLOR_YELLOWstring);
    return 
1;

i created this cmds to savecash and get the cash
after typng /savecash it saving the cash but when i do /getcash its saying You dont have that amount
pls help me


and i want to add
#define max_cash 20000
pls help me
Reply


Messages In This Thread
Simple help - by GoldenMan - 23.09.2017, 06:19
Re: Simple help - by GoldenMan - 23.09.2017, 07:44
Re: Simple help - by AzaMx - 23.09.2017, 08:06
Re: Simple help - by GoldenMan - 23.09.2017, 08:22
Re: Simple help - by GoldenMan - 23.09.2017, 10:06
Re: Simple help - by whadez - 23.09.2017, 10:20
Re: Simple help - by GoldenMan - 23.09.2017, 11:47
Re: Simple help - by SyS - 23.09.2017, 14:57
Re: Simple help - by GoldenMan - 23.09.2017, 19:57

Forum Jump:


Users browsing this thread: 1 Guest(s)