what's wrong with this CMD ?
#1

looks like this cmd don't alwas work in game! sometime even if the player have money server send the msg that he don't have founds
Код:
CMD:withdraw(playerid, params[])
{
	new amount,str[128];
	new PlayerName[24];
	if(!IsPlayerInRangeOfPoint(playerid, 10, 2657.0344, 712.1418, 17.0300)) return SendClientMessage(playerid, 0xFF0000AA, "You must be at Dealers Market to withdraw your cash!");
	if (sscanf(params, "d", amount)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /withdraw [amount]");
	if (amount < 0) return SendClientMessage(playerid, 0xFF0000AA, "you can't withdraw a negative amount");
	if (amount < dini_Int(file, "BANK") )
	{
		GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
		format(file, 128, USER_FILE, PlayerName);
 		dini_IntSet(file, "BANK", dini_Int(file, "BANK")-amount);
        GivePlayerMoney(playerid,(amount-(amount/10)));
        format(str, sizeof(str), "  You have withdraw $%d in your bank account(taxes $%d $), you have $%d in your account", amount,amount/10, dini_Int(file, "BANK"));
        SendClientMessage(playerid, 0x00FF00AA, str);
	}else return SendClientMessage(playerid, 0xFF0000AA, "You don't have that amount in bank");
	return 1;
}
Reply
#2

try changing
if (amount < dini_Int(file, "BANK") )

to

if (amount <= dini_Int(file, "BANK") )
Reply
#3

that wont change a lot (only 1$ diference)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)