Simple Quesiton (I Hope)
#1

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.
Reply
#2

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.
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)