How to make it.
#1

can someone tell me how to make a clock that shows in game time instead server time? thanks

in a textdraw is possible

and it shows in right-up corner of screen like SP clock
Reply
#2

Use gl_realtime FS
Reply
#3

yes but it uses real life time not in game time
Reply
#4

you want Clock with 1 min = 1 sec?
Reply
#5

i already made the time

i want a clock with 1 min = 30 sec
Reply
#6

so can anyone help?
Reply
#7

Put this include on pawno/include:
pawn Код:
/*  *  *  *  *  *  *  *  *  *  *
 * @Creator - ViruZZzZZ_ChiLLL *
 * @Version - 1.0.0            *
 * @Release Date - 27/07/2010  *
 * @Last Update - 27/07/2010   *
 * * * * * * * * * * * * * * * */


/*
   native ToggleVClock(toggle);
   native SetVClockTime(hour, minute);
*/


new Text:VClockTD;
new Vhour, Vminute;

stock ToggleVClock(toggle)
{
   if(toggle == 1){
   VClockTD = TextDrawCreate(546.000000,23.000000,"0:00 AM");
   TextDrawAlignment(VClockTD,0);
   TextDrawBackgroundColor(VClockTD,0x000000ff);
   TextDrawFont(VClockTD,2);
   TextDrawLetterSize(VClockTD,0.299999,1.600000);
   TextDrawColor(VClockTD,0xff0000ff);
   TextDrawSetProportional(VClockTD,1);
   TextDrawSetShadow(VClockTD,1);
   //SetTimer("VClock", 1000, true);
   /*Vhour = 12;
   Vminute = 00;*/

   TextDrawShowForAll(VClockTD);}
   return 0;
}

stock SetVClockTime(hour, minute)
{
   Vhour = hour;
   Vminute = minute;
   return 0;
}


forward VClock(playerid);
public VClock(playerid)
{
    Vminute++;
    if(Vminute >= 60)
    {
        Vminute = 0;
        Vhour++;
    }
    if(Vhour == 23 && Vminute == 59)
    {
        Vhour = 0;
        Vminute = 0;
    }
    new string[178];

    if(Vminute>=10)
    {
        if(Vhour >= 12 && Vhour <= 23 && Vminute <= 59){
        format(string,sizeof(string),"%d:%d PM",Vhour,Vminute);
        TextDrawSetString(VClockTD,string);}
        if(Vhour >= 0 && Vhour <= 11 && Vminute <= 59){
        format(string,sizeof(string),"%d:%d AM",Vhour,Vminute);
        TextDrawSetString(VClockTD,string);}
    }

    if(Vminute<10)
    {
        if(Vhour >= 12 && Vhour <= 23 && Vminute <= 59){
        format(string,sizeof(string),"%d:0%d PM",Vhour,Vminute);
        TextDrawSetString(VClockTD,string);}
        if(Vhour >= 0 && Vhour <= 11 && Vminute <= 59){
        format(string,sizeof(string),"%d:0%d AM",Vhour,Vminute);
        TextDrawSetString(VClockTD,string);}
    }


    if(Vhour == 0) return SetWorldTime(0);
    if(Vhour == 1) return SetWorldTime(1);
    if(Vhour == 2) return SetWorldTime(2);
    if(Vhour == 3) return SetWorldTime(3);
    if(Vhour == 4) return SetWorldTime(4);
    if(Vhour == 5) return SetWorldTime(5);
    if(Vhour == 6) return SetWorldTime(6);
    if(Vhour == 7) return SetWorldTime(7);
    if(Vhour == 8) return SetWorldTime(8);
    if(Vhour == 9) return SetWorldTime(9);
    if(Vhour == 10) return SetWorldTime(10);
    if(Vhour == 11) return SetWorldTime(11);
    if(Vhour == 12) return SetWorldTime(12);
    if(Vhour == 13) return SetWorldTime(13);
    if(Vhour == 14) return SetWorldTime(14);
    if(Vhour == 15) return SetWorldTime(15);
    if(Vhour == 16) return SetWorldTime(16);
    if(Vhour == 17) return SetWorldTime(17);
    if(Vhour == 18) return SetWorldTime(18);
    if(Vhour == 19) return SetWorldTime(19);
    if(Vhour == 20) return SetWorldTime(20);
    if(Vhour == 21) return SetWorldTime(21);
    if(Vhour == 22) return SetWorldTime(22);
    if(Vhour == 23) return SetWorldTime(23);
    return 1;
}
On your FS/GM, add on top: (save the include as: vclock.inc)
pawn Код:
#include <vclock>
On OnFilterScriptInit:
pawn Код:
SetTimer("VClock", 1000, true);
Just edited myself, for everyone's time be the same
Reply
#8

i installed it but it didnt work :S

the textdraw didnt show or anything
Reply
#9

Quote:
Originally Posted by stix
Посмотреть сообщение
i installed it but it didnt work :S

the textdraw didnt show or anything
On OnPlayerConnect:
pawn Код:
ToggleVClock(1);
Reply
#10

Damn thank you for your cooperation, Mr Blackwave.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)