withdraw command
#1

Help plz command withdraw
Код:
CMD:deposit(playerid, params[])
{
	new string[128], input;
	if(sscanf(params, "i", input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /deposit [amount]");
	if(GetPlayerMoney(playerid) < input) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't have that much money!");
	PlayerInfo[playerid][Bank] += input, GivePlayerMoney(playerid, -input);
	format(string, sizeof(string), "SERVER:{FFFFFF} You have deposited $%d into your bank account.", input);
	SendClientMessage(playerid, 0x46E850FF, string);
	return 1;
}
Reply
#2

pawn Код:
CMD:withdraw(playerid, params[])
{
    new string[128], input;
    if(sscanf(params, "i", input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /withdraw [amount]");
    if(PlayerInfo[playerid][Bank] < input) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't have that much money in bank!");
    PlayerInfo[playerid][Bank] -= input, GivePlayerMoney(playerid, input);
    format(string, sizeof(string), "SERVER:{FFFFFF} You have withdrawn $%d from your bank account.", input);
    SendClientMessage(playerid, 0x46E850FF, string);
    return 1;
}
Reply
#3

pawn Код:
CMD:withdraw(playerid, params[])
{
    new string[128], input;
    if(sscanf(params, "i", input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /withdraw[amount]");
    if(PlayerInfo[playerid][Bank] < input) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't have that much money in bank!");
    PlayerInfo[playerid][Bank] -= input, GivePlayerMoney(playerid, input);
    format(string, sizeof(string), "SERVER:{FFFFFF} You have withdraw $%d into your bank account.", input);
    SendClientMessage(playerid, 0x46E850FF, string);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)