Variable not raising in a "random" case?
#4

The random number is incorrect;

pawn Код:
forward RandomFish(playerid);
public RandomFish(playerid)
{
    new rand = random(2);
    switch(rand)
    {
        case 0:
        {
            fish[playerid]++;
            new string[128];
            format(string,sizeof(string), "Total Fish Carried: %d",fish);
            SendClientMessage(playerid,COLOR_GREEN, "You've caught a fish. /eat to eat it.");
            SendClientMessage(playerid,COLOR_GREY, string);
            return 1;
         }
         case 1:
         {
            RemovePlayerHealth(playerid, 10);
            SendClientMessage(playerid,COLOR_RED, "The fish bit you.");
         }
    }
    return 1;
}
Reply


Messages In This Thread
Variable not raising in a "random" case? - by rangerxxll - 09.03.2014, 22:14
Re: Variable not raising in a "random" case? - by Aerotactics - 09.03.2014, 22:31
Re: Variable not raising in a "random" case? - by rangerxxll - 09.03.2014, 23:41
Re: Variable not raising in a "random" case? - by Mr.Hardy - 09.03.2014, 23:53
Re: Variable not raising in a "random" case? - by rangerxxll - 10.03.2014, 01:34
Re: Variable not raising in a "random" case? - by Jefff - 10.03.2014, 01:39

Forum Jump:


Users browsing this thread: 1 Guest(s)