SA-MP Forums Archive
Lotto help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Lotto help (/showthread.php?tid=307364)



Lotto help - Face9000 - 30.12.2011

Hello guys,i've this code to select a lotto number for the draw,but there is a problem.

If i type /lotto - The script will choose automatically the number 0.

How to fix this and show the error message "Use: /lotto 1-30"...?

Here is the code:

pawn Код:
if(!strlen(params))
    {
        SendClientMessage(playerid, 0x62FF32FF, "***Lotto information***");
        SendClientMessage(playerid, 0x62FF32FF, "Pick a number between 1 and 30 with /lotto [1-30]");
        new str[75];
        format(str, sizeof(str), "Current Jackpot is $%d!!", Jackpot);
        SendClientMessage(playerid, 0x62FF32FF, str);
    }



Re: Lotto help - coole210 - 30.12.2011

Код:
if(!strlen(params))
    {
        SendClientMessage(playerid, 0x62FF32FF, "***Lotto information***");
        SendClientMessage(playerid, 0x62FF32FF, "Pick a number between 1 and 30 with /lotto [1-30]");
        new str[75];
        format(str, sizeof(str), "Current Jackpot is $%d!!", Jackpot);
        SendClientMessage(playerid, 0x62FF32FF, str);
        return 1;
    }
:d


Re: Lotto help - Face9000 - 30.12.2011

Thanks xD