SA-MP Forums Archive
Simple Quesiton (I Hope) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Simple Quesiton (I Hope) (/showthread.php?tid=314109)



Simple Quesiton (I Hope) - Rokzlive - 28.01.2012

Ok, heres my enum.

pawn Код:
enum MI
{
    Load[30],
    Pay,
    Type,
    LoadID,
    UnloadID
}
new MD[][MI] =
{
    {"Holy Water", 100, 1, 0, 1},
    {"Car Parts", 100, 1, 0, 2},
    {"Car Parts", 100, 2, 0, 2}
};
And here what i want to do. I want to select a random entry in the enum where Type = 2 and if there is none, it will send a client message saying "No entries for that type". I will be doing the same thing for other types as i add them, my only problem, i don't know how.


Re: Simple Quesiton (I Hope) - [XST]O_x - 28.01.2012

I don't exactly get what you mean...
Maybe this?
pawn Код:
new rand = random(sizeof(MD));
if(MD[rand][Type] == 2)
{
    //Something
}
else SendClientMessage(playerid, -1, "No entries for that type".);
Or explain better.


Re: Simple Quesiton (I Hope) - Rokzlive - 28.01.2012

Ill figure something out, because i cant explain it well enough.