how to show timer in gametext?
#6

Код:
new StopDealCount[MAX_PLAYERS];
new StopDealt[MAX_PLAYERS]; //the timer for each player

public OnPlayerExitVehicle(playerid, vehicleid)
{
    if( DealEnable[ playerid ] == 1 ){
        StopDealCount[playerid] = 20; //how many seconds it should take (15 or 20)
        StopDealt[playerid] = SetTimerEx("StopDeal", 1000, 1, "d", playerid); //1 second timer
        SendClientMessage(playerid, COLOR_RED, "Go back in your car!, else you will lose your Job!!");
        StopAudioStreamForPlayer(playerid);
    }
    return 1;
}
public StopDeal(playerid)
{
    if(StopDealCount[playerid] == 0)
    {
        SetPlayerWantedLevel(playerid, 0);
        DealEnable[ playerid ] = 0;
        SendClientMessage(playerid, COLOR_RED, "you quited your Job!");
        KillTimer(StopDealt[playerid]);
    }
    else
    {
        StopDealCount[playerid] --;
        new String[20];
        format(String, sizeof String, "Time left: %i", StopDealCount[playerid]);
        GameTextForPlayer(playerid, String);
    }
    return 1;
}
Reply


Messages In This Thread
how to show timer in gametext? - by niels44 - 04.02.2012, 18:05
Re: how to show timer in gametext? - by niels44 - 04.02.2012, 18:20
Re: how to show timer in gametext? - by InferNus` - 04.02.2012, 18:47
Re: how to show timer in gametext? - by niels44 - 04.02.2012, 18:49
Re: how to show timer in gametext? - by Konstantinos - 04.02.2012, 18:52
Re: how to show timer in gametext? - by ғαιιοцт - 04.02.2012, 18:53
Re: how to show timer in gametext? - by niels44 - 04.02.2012, 19:17

Forum Jump:


Users browsing this thread: 4 Guest(s)