Enum Information returns C?
#28

Quote:
Originally Posted by knackworst
Посмотреть сообщение
and uhm, how can I make the random only for the type 1 missions?
(or mission 1,2,3)
I tried this:
pawn Код:
new rand = random(sizeof Mission);
   
    if(gTeam[playerid] == TEAM_DRIVERS && level == 1)//nevermind this
    {
        if(Mission[rand][mission_type] == 1)
        {//blahblah more code
but then I can only go further when the random number turns 1, wich is not all the time...
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...
the define code is just there to check if the string array could be used if not we create a new array
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
}
Reply


Messages In This Thread
Enum Information returns C? - by knackworst - 01.10.2011, 18:50
Re: Enum Information returns C? - by [MWR]Blood - 01.10.2011, 19:01
Re: Enum Information returns C? - by kacper55331 - 01.10.2011, 19:07
Re: Enum Information returns C? - by knackworst - 01.10.2011, 19:10
Re: Enum Information returns C? - by [MWR]Blood - 01.10.2011, 19:12
Re: Enum Information returns C? - by knackworst - 01.10.2011, 19:14
Re: Enum Information returns C? - by [MWR]Blood - 01.10.2011, 19:16
Re: Enum Information returns C? - by knackworst - 01.10.2011, 19:18
Re: Enum Information returns C? - by [MWR]Blood - 01.10.2011, 19:23
Re: Enum Information returns C? - by knackworst - 01.10.2011, 19:34
Re: Enum Information returns C? - by MadeMan - 01.10.2011, 19:40
Re: Enum Information returns C? - by knackworst - 01.10.2011, 19:47
Re: Enum Information returns C? - by [MWR]Blood - 01.10.2011, 19:49
Re: Enum Information returns C? - by knackworst - 01.10.2011, 19:55
Re: Enum Information returns C? - by MadeMan - 01.10.2011, 19:56
Re: Enum Information returns C? - by knackworst - 01.10.2011, 20:27
Re: Enum Information returns C? - by MadeMan - 01.10.2011, 20:42
Re: Enum Information returns C? - by knackworst - 01.10.2011, 20:57
AW: Enum Information returns C? - by Nero_3D - 01.10.2011, 21:19
Re: Enum Information returns C? - by knackworst - 01.10.2011, 21:27
AW: Re: Enum Information returns C? - by Nero_3D - 01.10.2011, 21:40
Re: Enum Information returns C? - by knackworst - 01.10.2011, 21:47
AW: Re: Enum Information returns C? - by Nero_3D - 01.10.2011, 22:20
Re: Enum Information returns C? - by knackworst - 01.10.2011, 22:26
AW: Re: Enum Information returns C? - by Nero_3D - 01.10.2011, 22:48
Re: Enum Information returns C? - by knackworst - 01.10.2011, 22:51
Re: Enum Information returns C? - by knackworst - 02.10.2011, 00:31
AW: Re: Enum Information returns C? - by Nero_3D - 02.10.2011, 01:46
Re: Enum Information returns C? - by knackworst - 02.10.2011, 01:48
AW: Re: Enum Information returns C? - by Nero_3D - 02.10.2011, 02:03

Forum Jump:


Users browsing this thread: 1 Guest(s)