Saving race time not working.
#1

Hello samp forum!
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;
            }
        }
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?
Reply


Messages In This Thread
Saving race time not working. - by finelaq - 19.01.2015, 18:54
Re: Saving race time not working. - by Schneider - 19.01.2015, 19:00
Re: Saving race time not working. - by finelaq - 19.01.2015, 19:03
Re: Saving race time not working. - by Schneider - 19.01.2015, 19:05
Re: Saving race time not working. - by finelaq - 19.01.2015, 19:12
Re: Saving race time not working. - by Schneider - 19.01.2015, 19:22
Re: Saving race time not working. - by finelaq - 19.01.2015, 19:27
Re: Saving race time not working. - by Schneider - 19.01.2015, 19:34
Re: Saving race time not working. - by finelaq - 19.01.2015, 19:37
Re: Saving race time not working. - by Schneider - 19.01.2015, 19:39

Forum Jump:


Users browsing this thread: 1 Guest(s)