Random checkpoint except last one
#3

PHP код:
//global at the top of the script:
new LastCheckpoint[MAX_PLAYERS];
new 
Float:RandomCheckpoints[][] =
{
    {
123.145,123.123,123.123},
    {
156.156,156.156,156.156}
};
//Where you want to use it:
RandomCheckpoint_goto:
new 
rand random(sizeof(RandomCheckpoints));
if(
rand == LastCheckpoint[playerid])goto RandomCheckpoint_goto;
LastCheckpoint[playerid] = rand;
SetPlayerCheckpoint(playerid,RandomCheckpoints[rand][0],RandomCheckpoints[rand][1],RandomCheckpoints[rand][2]); 
I don't know if goto is a good solution but try this
If anyone have a better idea how it is solvable without goto please let me know it
Reply


Messages In This Thread
Random checkpoint except last one - by TheWay - 02.08.2015, 08:57
Re: Random checkpoint except last one - by Mariciuc223 - 02.08.2015, 09:02
Re: Random checkpoint except last one - by Mencent - 02.08.2015, 09:12
Re: Random checkpoint except last one - by Vince - 02.08.2015, 10:24

Forum Jump:


Users browsing this thread: 1 Guest(s)