/lotto problem
#1

Guys,How to check if the player's number that he wants to choose is already taken by another player in these codes:
pawn Код:
COMMAND:lotto(playerid, params[])
{
    new string[256], number;
    if(sscanf(params, "d", number)) return SendClientMessage(playerid, -1, "Syntax: {FF9900}/lotto [1 - 80]");
    if(LottoNumber[playerid] > 0) return SendClientMessage(playerid, -1, "You already have a lotto number.");
    if(number < 1 || number > 80) return SendClientMessage(playerid, -1, "Invalid lotto number. Number must be between 1 and 80.");
    if(LottoNum == 0) return SendClientMessage(playerid, -1, "There is not a lottery going on.");
    else
    {
        format(string, sizeof(string), "You picked number %d for the lottery.", number);
        SendClientMessage(playerid, -1, string);
        LottoNumber[playerid] = number;
        GivePlayerMoney(playerid, -100);
    }
    return 1;
}
Reply


Messages In This Thread
/lotto problem - by Youssef214 - 15.06.2014, 23:16
Re: /lotto problem - by Kimossab - 15.06.2014, 23:24
Re: /lotto problem - by Cutt3r - 15.06.2014, 23:30
Re: /lotto problem - by SickAttack - 15.06.2014, 23:40
Re: /lotto problem - by Kimossab - 15.06.2014, 23:49
Re: /lotto problem - by SickAttack - 15.06.2014, 23:57
Re: /lotto problem - by Barnwell - 16.06.2014, 00:07

Forum Jump:


Users browsing this thread: 1 Guest(s)