Auto draw Lotto
#1

This is the code I have and I want that to continuosly keep drawin lotto until we[ADMIN] type another command to stop it
Code:
Код:
dcmd_startlotto(playerid, params[])
{
    new string[256], lottopr;
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "[{FF0606}ERROR{FFFFFF}]: You have no authorization to use this command."); // If the player isnt logged in the RCON
    if(sscanf(params, "d", lottopr)) return SendClientMessage(playerid, -1, "Syntax: {FF9900}/setlotto <prize>"); // SSCANF, if you didn't type a prize the message /setlotto <prize> will show up as a syntax error
    if(lottopr < 10000 || lottopr > 5000000) return SendClientMessage(playerid, -1, "Invalid prize number. Prize must be between $10,000 and $5,000,000."); // Surpassing the prize limit
    if(LottoNum != 0) return SendClientMessage(playerid, -1, "There is a lottery already going on."); // Chking if there is a lottery already going on
    else
    {
        SendClientMessageToAll(-1, "A lottery has started and will end in 30 seconds! Type /lotto($100) to pick your number.");
        format(string, sizeof(string), "Prize: $%d", lottopr);
        SendClientMessageToAll(-1, string); // Sending the message to all players online
        LottoNum = 1 + random(100); // Setting the lotto number to 1 or more with a maximum of 80
        LottoPrize = lottopr; // Setting the prize of the lottery
        SetTimer("Lottery", 30000, false); // The timer until the lottery is finished
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)