SA-MP Forums Archive
Minute Second - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Minute Second (/showthread.php?tid=484989)



Minute Second - Configuration - 02.01.2014

Hello how to make somthing like this here in photo Minute/Seconds http://imgur.com/p4Bo0Y2


Re: Minute Second - Hansrutger - 02.01.2014

To send the message: https://sampwiki.blast.hk/wiki/SendClientMessage
To format the message to look good: https://sampwiki.blast.hk/wiki/Format
To calculate the amount of seconds: http://en.wikipedia.org/wiki/Modulo_operation
(For some reason that Pawn language is not included into the list but it's still as many other languages "%".

Formula to calculate seconds: minutes % 60
Formula to calculate minutes: the variable used above which is to be a float for this to work.

I won't build the command because you will probably ask how to build it and then someone else will do the work for you. I have basically explained the basics, if you don't understand format I shall tell but otherwise I'm not gonna' build this for you buddy.


Re: Minute Second - Configuration - 02.01.2014

can you make script?


Re: Minute Second - [EnErGyS]KING - 02.01.2014

Quote:
Originally Posted by The_Gangstas
Посмотреть сообщение
pawn Код:
TimeConvert(time) {
    new minutes;
    new seconds;
    new string[128];
    if(time > 59){
        minutes = floatround(time/60);
        seconds = floatround(time - minutes*60);
        if(seconds>9)format(string,sizeof(string),"%d:%d",minutes,seconds);
        else format(string,sizeof(string),"%d:0%d",minutes,seconds);
    }
    else{
        seconds = floatround(time);
        if(seconds>9)format(string,sizeof(string),"0:%d",seconds);
        else format(string,sizeof(string),"0:0%d",seconds);
    }
    return string;
}
example
pawn Код:
format(string, sizeof(string), "~w~Jail Time:~g~~h~%s", TimeConvert(PlayerInfo[i][PrisonTime]));
                TextDrawSetString(JailTimeText[i],string);
Here you are