mission help
#1

I know my english difficult to understand but please tries to help me

I want that when player do mission he wait 25 sec for other player if no other player join then discard mission otherwise mission starts.

How can I do this?
Reply
#2

i dind' understand anything you said...
Reply
#3

pawn Код:
new // global
    bool: MissionStarted,
    bool: IsPlayerOnMission[MAX_PLAYERS];
pawn Код:
// In your command or in your join code
    if(!MissionStarted)
        MissionStarted = true;
        SetTimerEx("AbortMission", 25 * 1000, false, "i", playerid);
    }
    IsPlayerOnMission[playerid] = true;
pawn Код:
//somewhere outside
forward AbortMission(starter);
public AbortMission(starter) {
    for(new i, count = -1; i != MAX_PLAYERS; ++i) {
        if(IsPlayerOnMission[i]) {
            if(++count) {
                // mission started
                return ;
            }
        }
    }
    GameTextForPlayer(starter, "Mission aborted", 4000, 3);
    IsPlayerOnMission[starter] = false;
    MissionStarted = false;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)