SA-MP Forums Archive
Random Missions - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Random Missions (/showthread.php?tid=185243)



Random Missions - Brian_Furious - 23.10.2010

I want to put a random mission how to do. I have this script:

pawn Код:
#define MAX_MISSIONI 1000

enum eMissioni { //Elenco Missioni
    TM, //Terroristi vs Mafia
    Shoting, // Sparatoria
};
new Missione[eMissioni][MAX_PLAYERS];
new RandomMissions[MAX_MISSIONI][2] = {
    TM,
    Shoting,
};



Re: Random Missions - LarzI - 23.10.2010

Wherever you start your missions, you do:

pawn Код:
new iRand = random( sizeof RandomMissions );
RandomMissions[ iRand ];
Or something like that.
Depends on how you construct the code, really.

Btw, [2] should be lenght of the strings. You can really just do [] instead of [2]


Re: Random Missions - Brian_Furious - 23.10.2010

Quote:
Originally Posted by LarzI
Посмотреть сообщение
Wherever you start your missions, you do:

pawn Код:
new iRand = random( sizeof RandomMissions );
RandomMissions[ iRand ];
Or something like that.
Depends on how you construct the code, really.

Btw, [2] should be lenght of the strings. You can really just do [] instead of [2]
can you put a exemple please?


Re: Random Missions - LarzI - 23.10.2010

I'm afraid not.
If you post how to call/start your missions, I could though.


Re: Random Missions - Brian_Furious - 23.10.2010

Quote:
Originally Posted by LarzI
Посмотреть сообщение
I'm afraid not.
If you post how to call/start your missions, I could though.
I want to start a DM Missions, when i start the I would like the server chooses a random Mission


Re: Random Missions - LarzI - 23.10.2010

Like OnGameModeInit?


Re: Random Missions - Brian_Furious - 23.10.2010

Quote:
Originally Posted by LarzI
Посмотреть сообщение
Like OnGameModeInit?
yes, like that