Help Random
#1

I wanted to make a player to be given a random ammount of something i know how to make the random but how can i make for example when a player is gardening and he is picking flowers example
Код:
 pTulip pRose
he gets a random either is pRose or a pTulip and a random ammount of Roses or Tulips?
Reply
#2

Use the random function. Doing something like:

pawn Код:
new RandFlower = random(2);
switch(RandFlower) {
    case 0: {
        pTulip[playerid]++;
        SendClientMessage(playerid, colour, "You picked a Tulip!");
    }
    case 1: {
        pRose[playerid]++;
        SendClientMessage(playerid, colour, "You picked a Rose!");
    }
}
Reply
#3

Fixed
Reply
#4

There is no case 3, 2 is the maximum value RandRuda can assume.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)