23.09.2017, 06:19
PHP код:
CMD:savecash(playerid, params[])
{
if (playeritems[playerid][ITEM_TYPE_Breifcase] == 0) return SendClientMessage2(playerid, COLOR_RED, "You don't have a breifcase buy it from nearest store!");
new cash;
if(sscanf(params, "d", cash)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /savecash [Amount]");
new pcash = GetPlayerMoney(playerid);
if(pcash < cash) return SendClientMessage(playerid, COLOR_RED, "Error: You don't have that amount!");
new name[26];
GetPlayerName(playerid, name, 26);
dini_IntSet(AddDirFile(dir_userfiles, name), "Briefcasecash", cash);
GivePlayerMoney(playerid, -cash);
new string[256];
format(string, sizeof(string), "You have deposited %d from your briefcase. You have now %d", cash, dini_Int(AddDirFile(dir_userfiles, name), "Briefcasecash"));
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
CMD:getbccash(playerid, params[])
{
if (playeritems[playerid][ITEM_TYPE_Breifcase] == 0) return SendClientMessage2(playerid, COLOR_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(playerid, COLOR_WHITE, "Usage: /getcash [Amount]");
if(dini_Int(AddDirFile(dir_userfiles, name), "Briefcasecash") < cash) return SendClientMessage(playerid, COLOR_RED, "Error: You don't have that amount!");
dini_IntSet(AddDirFile(dir_userfiles, name), "Briefcasecash", dini_Int(AddDirFile(dir_userfiles, name), "Briefcasecash") - cash);
GivePlayerMoney(playerid, cash);
new string[256];
format(string, sizeof(string), "You have Withdrawn %d from your briefcase. You have now %d", cash, dini_Int(AddDirFile(dir_userfiles, name), "Briefcasecash"));
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
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