Lotto command help
#1

Hello,i need a little help with my /lotto command.The problem is,if i type just /lotto it will automatically buy the number 0,how to fix this?I think params are working.

pawn Код:
CMD:lotto(playerid, params[])
{
    if(!strlen(params)) return SendClientMessage(playerid,0xFF0000FF, "Pick a number between 1 and 50 with /lotto [50]");
    new Num = strval(params);
    if(GetPlayerMoney(playerid) <500) return SendClientMessage(playerid,0xAA3333AA, "You don't have 500$ to buy a lotto number.");
    new strl[128];
    format(strl, sizeof(strl), "Current Lotto Jackpot is {F70505}%d$", Jackpot);
    SendClientMessage(playerid, COLOR_BLUE, strl);
    if(Numbers[Num] == 1)
    {
        new str[75];
        format(str, sizeof(str), "Lotto number %d is already taken,choose another.", Num);
        SendClientMessage(playerid, 0xE21F1FFF, str);
        return 1;
    }
    if(GetPVarInt(playerid, "LottoNumber") != 0) return SendClientMessage(playerid, ORANGE, "You have already selected a lotto number,good luck!");
    Numbers[Num] = 1;
    new str[140];
    GivePlayerMoney(playerid, -TICKET_COST);
    SetPVarInt(playerid, "LottoNumber", Num);
    format(str, sizeof(str), "Lotto number %d bought! Good luck baby!", Num);
    SendClientMessage(playerid, COLOR_WHITE, str);
    format(str, sizeof(str), "Draws are held every %d minutes and the winners are announced on global chat. Current jackpot is ***%d$***", LOTTO_DRAW, Jackpot);
    Jackpot = Jackpot + LOTTO_JACKPOT;
    SendClientMessage(playerid, 0x62FF32FF, str);
    return 1;
}
Thanks.
Reply


Messages In This Thread
Lotto command help - by Face9000 - 04.10.2012, 10:20
Re: Lotto command help - by JaKe Elite - 04.10.2012, 10:24
Re: Lotto command help - by Face9000 - 04.10.2012, 17:56
Re: Lotto command help - by Vince - 04.10.2012, 18:28

Forum Jump:


Users browsing this thread: 1 Guest(s)