19.01.2015, 19:27
Quote:
Ok,
can you show us the piece of code where RaceMinutes/RaceSeconds/RaceMiliSeconds are set when the race is finished? |
pawn Код:
public RaceTimer(playerid)
{
RaceMiliSeconds[playerid] += 100;
if(RaceMiliSeconds[playerid] == 1000)
{
RaceSeconds[playerid]++;
RaceMiliSeconds[playerid] = 0;
}
if(RaceSeconds[playerid] == 60)
{
RaceMinutes[playerid]++;
RaceSeconds[playerid] = 0;
}
new string[16];
format(string, 16, "%d:%d:%d", RaceMinutes[playerid], RaceSeconds[playerid], RaceMiliSeconds[playerid]);
TextDrawSetString(Race[playerid], string);
}
pawn Код:
else if (CP[playerid] == 11)
{
new string[70];
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, -1, "[Mission]: Sultan mission is completed! You get +$1200 ja +2 score!");
GivePlayerCash(playerid, 1200);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
Missioonil[playerid] = 0;
KillTimer(RaceT[playerid]);
format(string, sizeof(string),"[Mission]: You ended Sultan missioni. Time: %d:%d:%d.",RaceMinutes[playerid], RaceSeconds[playerid], RaceMiliSeconds[playerid]);
SendClientMessage(playerid, -1, string);
TextDrawHideForPlayer(playerid, Race[playerid]);
if(RaceMinutes[playerid] >= 1)
{
if(RaceSeconds[playerid] < pInfo[playerid][SultanSeconds])
{
pInfo[playerid][SultanMiliSeconds] = RaceMiliSeconds[playerid];
pInfo[playerid][SultanSeconds] = RaceSeconds[playerid];
pInfo[playerid][SultanMinutes] = RaceMinutes[playerid];
SavePlayer(playerid);
format(string, sizeof(string),"[Mission]: This is your new record: %d:%d:%d.",RaceMinutes[playerid], RaceSeconds[playerid], RaceMiliSeconds[playerid]);
SendClientMessage(playerid, -1, string);
RaceMinutes[playerid] = 0;
RaceSeconds[playerid] = 0;
RaceMiliSeconds[playerid] = 0;
}
else
{
format(string, sizeof(string),"[Mission]: Your best time is: %d:%d:%d.",pInfo[playerid][SultanMinutes], pInfo[playerid][SultanSeconds], pInfo[playerid][SultanMiliSeconds]);
SendClientMessage(playerid, -1, string);
RaceMinutes[playerid] = 0;
RaceSeconds[playerid] = 0;
RaceMiliSeconds[playerid] = 0;
}
}
else
{
if(RaceSeconds[playerid] < pInfo[playerid][SultanSeconds])
{
pInfo[playerid][SultanMiliSeconds] = RaceMiliSeconds[playerid];
pInfo[playerid][SultanSeconds] = RaceSeconds[playerid];
pInfo[playerid][SultanMinutes] = RaceMinutes[playerid];
SavePlayer(playerid);
format(string, sizeof(string),"[Mission]: This is your new record: %d:%d:%d.",RaceMinutes[playerid], RaceSeconds[playerid], RaceMiliSeconds[playerid]);
SendClientMessage(playerid, -1, string);
RaceMinutes[playerid] = 0;
RaceSeconds[playerid] = 0;
RaceMiliSeconds[playerid] = 0;
}
else
{
format(string, sizeof(string),"[Mission]: Your best time is: %d:%d:%d.",pInfo[playerid][SultanMinutes], pInfo[playerid][SultanSeconds], pInfo[playerid][SultanMiliSeconds]);
SendClientMessage(playerid, -1, string);
RaceMinutes[playerid] = 0;
RaceSeconds[playerid] = 0;
RaceMiliSeconds[playerid] = 0;
}
}
}