[Help]Printing/Getting lap time.
#8

Quote:
Originally Posted by leonardo1434
Посмотреть сообщение
Just made it quickly.
pawn Код:
CMD:startlap(playerid,params[])
{
    SetPVarInt(playerid,"lap",gettime()); //setting a var and stocking his value.
    return 1;
}
CMD:finishlap(playerid,params[])
{
    static string[50];
    SetPVarInt(playerid,"totalseconds",gettime() - GetPVarInt(playerid,"lap")); // setting the var second + getting the actul time - var lap which is the time that started the lap.
    SetPVarInt(playerid,"seconds",GetPVarInt(playerid,"totalseconds")% 60);// setting the var seconds
    SetPVarInt(playerid,"minutes",(GetPVarInt(playerid,"totalseconds") - GetPVarInt(playerid,"seconds"))/60);//setting the var minutes, which is the total of seconds - seconds.
    format(string,50,"You have finished in %i minutes and %i seconds",GetPVarInt(playerid,"minutes"),GetPVarInt(playerid,"seconds")); // formating the string
    SendClientMessage(playerid,-1,string);//sending to the playerid.
    return 1;
}
PVars!

Thanks gentlemen, that worked and I learned how this works

Thank you once again.

+reps for ya all.
Reply


Messages In This Thread
[Help]Printing/Getting lap time. - by Ronaldo_raul™ - 12.07.2012, 12:45
Re: [Help]Printing/Getting lap time. - by clarencecuzz - 12.07.2012, 12:57
Re: [Help]Printing/Getting lap time. - by Ronaldo_raul™ - 13.07.2012, 16:41
Re: [Help]Printing/Getting lap time. - by Roko_foko - 13.07.2012, 16:44
Re: [Help]Printing/Getting lap time. - by Ronaldo_raul™ - 13.07.2012, 17:15
Re: [Help]Printing/Getting lap time. - by Ronaldo_raul™ - 14.07.2012, 17:18
Re: [Help]Printing/Getting lap time. - by leonardo1434 - 14.07.2012, 18:24
Re: [Help]Printing/Getting lap time. - by Ronaldo_raul™ - 15.07.2012, 07:51
Re: [Help]Printing/Getting lap time. - by Niko_boy - 15.07.2012, 08:00
Re: [Help]Printing/Getting lap time. - by Ronaldo_raul™ - 15.07.2012, 09:35

Forum Jump:


Users browsing this thread: 3 Guest(s)