How do i check if the player finished first?
#4

pawn Код:
new nascarwinner; // outside any callback

OnGameModeInit
{
    nascarwinner = INVALID_PLAYER_ID;
}

else if(nascarcheckpoints[playerid] == 13)
{
    if(nascarwinner == INVALID_PLAYER_ID) // 1st
    {
        nascarwinner = playerid;
        nascarcheckpoints[playerid] = 0;
        new cash= random(250000);
        new fe[128];
        format(fe, sizeof(fe), "+%d$", cash);
        SendClientMessage(playerid, YELLOW, fe);
        new string[MAX_PLAYER_NAME+32], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(string, sizeof string, "1st. | %s" name);
        for(new idx; idx != MAX_PLAYERS; idx++) if(!IsPlayerConnected(idx) || !nascarcheckpoints[idx]) continue;
        { SendClientMessage(idx, YELLOW, string); }
    }
}

//Next time race starts make sure you set race has no winner yet..
nascarwinner = INVALID_PLAYER_ID;
Reply


Messages In This Thread
How do i check if the player finished first? - by dan40o - 14.01.2015, 16:20
Re: How do i check if the player finished first? - by erminpr0 - 14.01.2015, 18:21
Re: How do i check if the player finished first? - by dan40o - 14.01.2015, 21:23
Re: How do i check if the player finished first? - by erminpr0 - 15.01.2015, 12:10
Re: How do i check if the player finished first? - by erminpr0 - 15.01.2015, 12:18
Re: How do i check if the player finished first? - by dan40o - 15.01.2015, 19:50

Forum Jump:


Users browsing this thread: 1 Guest(s)