Little Help after Buying Lotto
#1

Problem is the when I do /lotto I automatically get ticket 0. But I did not put any value? What could be the problem?


pawn Код:
dcmd_lotto(playerid, params[])
{
    if(!strlen(params))
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Usage: /lotto [1-100]");
        new str[75];
        format(str, sizeof(str), "{FF9900}>> Current Jackpot is $%d", Jackpot);
        SendClientMessage(playerid, 0xFFFFFFFF, str);
    }
    new Num = strval(params);
    if(Numbers[Num] == 1)
    {
        new str[75];
        format(str, sizeof(str), "{FF0000}>> Lotto number %d is already taken", Num);
        SendClientMessage(playerid, 0xFFFFFFFF, str);
        return 1;
    }
    if(GetPVarInt(playerid, "LottoNumber") != 0) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}You have already got a lotto number");
    SetPVarInt(playerid, "LottoNumber", Num);
    Numbers[Num] = 1;
    GivePlayerMoney(playerid, -TICKET_COST);
    new str[100];
    format(str, sizeof(str), ">> Lotto ticket brought! You now have number %d for the next draw", Num);
    SendClientMessage(playerid, 0xFFFFFFFF, str);
    format(str, sizeof(str), ">> Draws are held every %d minutes and the winners are announced. Current Jackpot is $%d", LOTTO_DRAW, Jackpot);
    Jackpot = Jackpot + LOTTO_JACKPOT;
    SendClientMessage(playerid, 0xFFFFFFFF, str);
    return 1;
}
Reply


Messages In This Thread
Little Help after Buying Lotto - by kbalor - 10.09.2012, 13:42
Re: Little Help after Buying Lotto - by Gangster-rocks - 10.09.2012, 13:51
Re: Little Help after Buying Lotto - by Roel - 10.09.2012, 13:51
Re: Little Help after Buying Lotto - by Roel - 10.09.2012, 13:53
Re: Little Help after Buying Lotto - by Gangster-rocks - 10.09.2012, 13:55
Re: Little Help after Buying Lotto - by Roel - 10.09.2012, 13:57
Re: Little Help after Buying Lotto - by kbalor - 10.09.2012, 14:14

Forum Jump:


Users browsing this thread: 4 Guest(s)