CMD causing server crash
#1

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;
}
I dont know why but its causing the server to crash it doesnt show the client messages i added it crashes when i do for eg: /wiretransfer 0 1231231

Any help?
Reply
#2

"$%i" is "$ %i" if still not fixed, put the log so I can have a look at it (if it warns or shows error)
Reply
#3

Still crashes and nothing happens on the server log, it just crashes
Reply
#4

Quote:
Originally Posted by RLGaming
Посмотреть сообщение
Still crashes and nothing happens on the server log, it just crashes
CHECK for Brackets if not I will check the script in my computer when I get home, for now try to redo it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)