[Question] About random..again..
#10

This function might help you.

pawn Код:
enum DrugInfo
{
    Crack,
    Marijuana,
    Weed,
    Cocaine,
    Canabis,
    Ganja,
    Heroin,
}
new DrugType[MAX_PLAYERS][DrugInfo];

GivePlayerRandomDrug(playerid)
{
    new
        iRand = random(7);
    switch(iRand)
    {
        case Crack:
        {
            DrugType[playerid][Crack]++;
            SendClientMessage(playerid, 0x00FF00AA, "You have found a package of crack.");
        }
        case Marijuana:
        {
            DrugType[playerid][Marijuana]++;
            SendClientMessage(playerid, 0x00FF00AA, "You have found a package of marijuana.");
        }
        case Weed:
        {
            DrugType[playerid][Weed]++;
            SendClientMessage(playerid, 0x00FF00AA, "You have found a package of weed.");
        }
        case Cocaine:
        {
            DrugType[playerid][Cocaine]++;
            SendClientMessage(playerid, 0x00FF00AA, "You have found a package of cocain.");
        }
        case Canabis:
        {
            DrugType[playerid][Canabis]++;
            SendClientMessage(playerid, 0x00FF00AA, "You have found a package of cannabis.");
        }
        case Ganja:
        {
            DrugType[playerid][Ganja]++;
            SendClientMessage(playerid, 0x00FF00AA, "You have found a package of ganja.");
        }
        case Heroin:
        {
            DrugType[playerid][Heroin]++;
            SendClientMessage(playerid, 0x00FF00AA, "You have found a package of heroin.");
        }
    }
}
Reply


Messages In This Thread
[Question] About random..again.. - by boelie - 26.08.2011, 14:58
Re: [Question] About random..again.. - by Kingunit - 26.08.2011, 15:01
Re: [Question] About random..again.. - by Lenny the Cup - 26.08.2011, 15:05
Re: [Question] About random..again.. - by boelie - 26.08.2011, 15:41
Re: [Question] About random..again.. - by iggy1 - 26.08.2011, 15:44
Re: [Question] About random..again.. - by boelie - 26.08.2011, 15:48
Re: [Question] About random..again.. - by iggy1 - 26.08.2011, 15:50
Re: [Question] About random..again.. - by boelie - 26.08.2011, 15:59
Re: [Question] About random..again.. - by boelie - 26.08.2011, 17:00
Re: [Question] About random..again.. - by iggy1 - 27.08.2011, 07:48

Forum Jump:


Users browsing this thread: 1 Guest(s)