02.10.2011, 01:46
Quote:
and uhm, how can I make the random only for the type 1 missions?
(or mission 1,2,3) I tried this: pawn Код:
so I need a random that goes random through the mission with mission_type 1 (it are the first 3 missions aswell) yes I know i was going to stop posting and asking about this... but I just couldn't figure out... |
pawn Код:
if(gTeam[playerid] == TEAM_DRIVERS && level == 1)
{
new
i = 0,
rand = 0;
#if sizeof Mission <= sizeof string
#define tmp string
#else
new tmp[sizeof Mission];
#endif
for( ; i != sizeof Mission; ++i)
{
if(Mission[i][mission_type] == 1)
{
tmp[rand++] = i;
}
}
if(rand)
{
rand = tmp[random(rand)];
format(string, sizeof string, "Mission: \"%s\" Person: \"%s\"", Mission[rand][mission_name], Mission[rand][person_name]);
SendClientMessage(playerid, COLOR_YELLOW_LABEL, string);
}
#if sizeof Mission <= sizeof string
#undef tmp
#endif
}