Simple help
#3

Not sure but give a try

Код:
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;
}
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: 2 Guest(s)