Loop Spam
#1

Hi. I'm a real newbie with loops. Can anyone help me? This whole function is spammed every hour.

pawn Код:
public Payday()
{
    foreach (new i : Player)
    {
            new wstring[256];
            new randcheck = 20 + random(300);
            new interest = (PlayerInfo[i][pBankAccount]/1000)*(intrate);
            new newbank = PlayerInfo[i][pBankAccount] + randcheck;
            new randtax = 5 + random(20);

            SCM(i, -1, "___________________[PAYDAY INFORMATION]___________________");
            format(wstring, sizeof(wstring), "~w~PayDay ~n~~g~$%d", randcheck);
            GameTextForPlayer(i, wstring, 3000, 1);
            PlayerInfo[i][pBankAccount] += randcheck;

            format(wstring, sizeof(wstring), "PayCheck: $%d", randcheck);
            SendClientMessage(i,COLOR_WHITE, wstring);
            format(wstring, sizeof(wstring), "Interest Gained: $%d, Interest Rate: 0.%d percent.", interest, intrate);
            SendClientMessage(i,COLOR_WHITE, wstring);
            format(wstring, sizeof(wstring), "Government Taxes: $-%d.", randtax);
            SendClientMessage(i,COLOR_WHITE, wstring);
            format(wstring,sizeof(wstring), "New bank balance: $%d", newbank);
            SCM(i, COLOR_WHITE, wstring);
            PlayerInfo[i][pBankAccount] += interest;
            PlayerInfo[i][pBankAccount] -= randtax;
            PlayerInfo[i][pPlayingHours] += 1;
            break;
    }
}
Reply


Messages In This Thread
Loop Spam - by Chrillzen - 05.03.2014, 16:36
Re: Loop Spam - by Lajko1 - 05.03.2014, 16:44
Re: Loop Spam - by doreto - 05.03.2014, 17:12
Re: Loop Spam - by Chrillzen - 05.03.2014, 17:16
Re: Loop Spam - by Konstantinos - 05.03.2014, 17:19
Re: Loop Spam - by Chrillzen - 06.03.2014, 08:43

Forum Jump:


Users browsing this thread: 3 Guest(s)