04.02.2012, 18:53
Код:
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; }