27.08.2011, 07:48
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.");
}
}
}