19.01.2015, 18:54
Hello samp forum!
So i have this code:
I don't know is this the best code
But the problem is, when i end the race it tells me: "Your best time is: 0:0:0" And sometimes tell me "This is your new record: 0:0:0."
I don't understand where is the problem?
So i have this code:
pawn Код:
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;
}
}
But the problem is, when i end the race it tells me: "Your best time is: 0:0:0" And sometimes tell me "This is your new record: 0:0:0."
I don't understand where is the problem?