[HELP] Lucky or not?
#3

Quote:
Originally Posted by Not available
Посмотреть сообщение
This has a 50% chance of failing.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/test", cmdtext, true))
    {
        new lucky = random(1);
        if(lucky == 1)
        {
            SendClientMessage(playerid, 0xFF0000FF, "You're lucky.")
            GivePlayerMoney(playerid, 10000);
            return 1;
        }
        SendClientMessage(playerid, 0xFF0000FF, "You're unlucky.")
        return 1;
    }
}
Well acutally it has 100% chance of failing, this is correct:

pawn Код:
new lucky = random(2);
Reply


Messages In This Thread
[HELP] Lucky or not? - by Larsey123IsMe - 23.01.2011, 01:54
Re: [HELP] Lucky or not? - by Not available - 23.01.2011, 02:08
Re: [HELP] Lucky or not? - by iMonk3y - 23.01.2011, 02:14

Forum Jump:


Users browsing this thread: 1 Guest(s)