03.01.2018, 17:23
use gettime in the beginning and end of the race, ex code: (EXAMPLE DONT COPY PASTE IT WONT MAGICALLY WORK):
read that and comprehend the concept and apply it.
PHP код:
new hour[MAX_PLAYERS],minute[MAX_PLAYERS],second[MAX_PLAYERS];
public OnRaceStart(playerid)//random
{
gettime(hour[playerid],minute[playerid],second[playerid]);
return 1;
}
public OnRaceEnd(playerid)
{
new hourx[MAX_PLAYERS],minutex[MAX_PLAYERS],secondx[MAX_PLAYERS],pname[26],string[80];
gettime(hourx[playerid],minutex[playerid],secondx[playerid]);
GetPlayerName(playerid,pname,sizeof(pname));
if(minutex[playerid] > minute[playerid] && secondx[playerid] => second[playerid]) format(string,sizeof(string),"Player %s finished the race in %d minute(s) and %d second(s) "pname,minutex[playerid]-minute[playerid],secondx[playerid]);
else format(string,sizeof(string),"Player %s finished the race in %d minute(s) and %d second(s) "pname,minute[playerid],secondx[playerid]-second[playerid]);
SendClientMessageToAll(-1,string);
return 1;
}