13.10.2012, 21:22
pawn Код:
CMD:wiretransfer(playerid, params[])
{
new giveplayerid, string[128], amount;
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1500.1027,-1035.2893,601.5460))
{
if(sscanf(params, "ui", giveplayerid, amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /wiretransfer [playerid] [amount]");
if(BankInfo[playerid][pBankAccount] < amount)
{
SendClientMessage(playerid, COLOR_WHITE, "Insufficent funds to transfer that amount of money!");
}
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_WHITE, "You cannot transfer money to yourself!");
return 1;
}
else
{
BankInfo[playerid][pBankAccount] -= amount;
BankInfo[giveplayerid][pBankAccount] += amount;
format(string, sizeof(string), "BANK: You have received $%i into your bank account from %s.", amount, GetPlayerNameEx(playerid));
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "BANK: You have transferred $%i into %s's bank account.", amount, GetPlayerNameEx(giveplayerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "BANK: %s has transferred $%i into %s's bank account.", GetPlayerNameEx(playerid), amount, GetPlayerNameEx(giveplayerid));
Log("log/transactions.log", string);
format(string, sizeof(string), "AdmCmd: %s has transferred $%i into %s's bank account.", GetPlayerNameEx(playerid), amount, GetPlayerNameEx(giveplayerid));
ABroadCast(COLOR_LIGHTRED, string, 1);
}
}
else SendClientMessage(playerid, COLOR_WHITE, "Invalid player ID.");
}
else SendClientMessage(playerid, COLOR_WHITE, "You need to be in the bank to use this command!");
return 1;
}
Any help?