19.11.2014, 18:03
I forgot to post full Timer with TaxiMeter (for TAXI job) and PhoneCallCheck
Should i do the same, to call the Timer when player JOIN ?
Код:
task TimerForAll[1000]() { new sendername[MAX_PLAYER_NAME], str[256]; for(new i = 0; i < MAX_PLAYERS; i++) { if(TaxiTime[i] > 0 && TaxiDriver[i] < 999 && IsPlayerInAnyVehicle(i) && IsATaxiJobVehicle(GetPlayerVehicleID(i))) { if(GetPlayerMoney(i) <= TaxiTime[i]) { GivePlayerMoney(i, -TaxiTime[i]); RemovePlayerFromVehicle(i); TaxiMoney[TaxiDriver[i]] += TaxiTime[i]; format(str, sizeof(str), "Nemate dovoljno novca da nastavite voznju, platili ste %d$", TaxiTime[i]); SCM(i, BOJA_NARANDZASTA, str); format(str, sizeof(str), "Putnik nema dovoljno novca da nastavi voznju. Napustio je vozilo i platio (20)+%d$", TaxiTime[i]); SCM(TaxiDriver[i], BOJA_NARANDZASTA, str); TaxiTime[i] = 0; TaxiDriver[i] = 0; } else { TaxiTime[i] += 1; format(str, sizeof(str), "CENA VOZNJE: %d", TaxiTime[i]); GameTextForPlayer(i, str, 1000, 6); } } else if(InCall[i] != 999 && iCall[i] != 999) { if(PlayerInfo[i][pMobileCredit] == 0) { iCall[i] = 999; InCall[i] = 999; InCall[CalledPlayer[i]] = 999; SCM(i, BOJA_CRVENA, "Nemate dovoljno kredita da nastavite razgovor!"); GetPlayerName(i, sendername, sizeof(sendername)); format(str, sizeof(str), "%s nema dovoljno kredita da nastavi razgovor!", sendername); SCM(CalledPlayer[i], BOJA_CRVENA, str); Caller[CalledPlayer[i]] = 999; CalledPlayer[i] = 999; } else { PlayerInfo[i][pMobileCredit] -= 1; SavePlayer(i); } } } }