02.10.2011, 02:03
So the two codes put together
pawn Код:
// indentation
if((strcmp("/mission", cmdtext, true, 8) == 0) && (gTeam[playerid] == TEAM_DRIVERS) && (level == 1))
{
new
i = 0,
count = 0,
type = strval(cmdtext[8]);
#if sizeof Mission <= sizeof string
#define tmp string
#else
new tmp[sizeof Mission];
#endif
for( ; i != sizeof Mission; ++i)
{
if(Mission[i][mission_type] == type)
{
tmp[count++] = i;
}
}
if(count)
{
i = tmp[random(count)];
format(string, sizeof string, "Mission: \"%s\" Person: \"%s\"", Mission[i][mission_name], Mission[i][person_name]);
SendClientMessage(playerid, COLOR_YELLOW_LABEL, string);
return true;
}
#if sizeof Mission <= sizeof string
#undef tmp
#endif
}