Minute Second
#1

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

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.
Reply
#3

can you make script?
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)