I need help!
#5

use gettime in the beginning and end of the race, ex code: (EXAMPLE DONT COPY PASTE IT WONT MAGICALLY WORK):
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;

read that and comprehend the concept and apply it.
Reply


Messages In This Thread
I need help! - by Thanks - 03.01.2018, 16:51
Re: I need help! - by Baseball - 03.01.2018, 16:55
Re: I need help! - by Thanks - 03.01.2018, 16:56
Re: I need help! - by Baseball - 03.01.2018, 16:57
Re: I need help! - by RogueDrifter - 03.01.2018, 17:23
Re: I need help! - by Thanks - 03.01.2018, 17:47

Forum Jump:


Users browsing this thread: 1 Guest(s)