GTAMulti - GTA Türkiye

San Andreas Multiplayer => Mod Galerisi => PAWN Kodlama => Kilitli Konular => Konuyu başlatan: Courage - 22 Ağustos 2018, 15:48:15

Başlık: Zaman&Tarih Sistemi
Gönderen: Courage - 22 Ağustos 2018, 15:48:15
Merhaba arkadaşlar sunucum'da bulunan Saat&Tarih sistemini sizlere sunuyorum umarım işinize yaramıştır. Sistem roleplay sunucuları için ideal'dır, hapistey'ken /zaman yazdığınız'da kalan süreyi gösterir ayrıca sunucu içerisin'de /zaman yazdığınız'da saati ve tarihi gösterir.


CMD:zaman(playerid, params[])
{
new string[128];
    new mtext[20];
    new year, month,day;
    getdate(year, month, day);
    if(month == 1) { mtext = "Ocak"; }
    else if(month == 2) { mtext = "Subat"; }
    else if(month == 3) { mtext = "Mart"; }
    else if(month == 4) { mtext = "Nisan"; }
    else if(month == 5) { mtext = "Mayis"; }
    else if(month == 6) { mtext = "Haziran"; }
    else if(month == 7) { mtext = "Temmuz"; }
    else if(month == 8) { mtext = "Agustos"; }
    else if(month == 9) { mtext = "Eylul"; }
    else if(month == 10) { mtext = "Ekim"; }
    else if(month == 11) { mtext = "Kasim"; }
    else if(month == 12) { mtext = "Aralik"; }
    new hour,minuite,second;
    gettime(hour,minuite,second);
    FixHour(hour);
    hour = shifthour;
    if(minuite < 10)
{
        if(PlayerInfo[playerid][pJailTime] > 0)
{
            format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|~n~~w~Kalan Hapis Suresi: %d saniye", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]);
        }
        else
{
            format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|", day, mtext, hour, minuite);
        }
    }
    else
{
        if(PlayerInfo[playerid][pJailTime] > 0)
{
            format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|~n~~w~Kalan Hapis Suresi: %d saniye", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]);
        }
        else
{
            format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|", day, mtext, hour, minuite);
        }
    }
    GameTextForPlayer(playerid, string, 5000, 1);
    return 1;
}
Başlık: Ynt: Zaman&Tarih Sistemi
Gönderen: Jawié - 22 Ağustos 2018, 19:56:12
Bu kod anca çıkarttığın modda işe yarar, başka bir modda çalışmaz.
Başlık: Ynt: Zaman&Tarih Sistemi
Gönderen: Rouge. - 22 Ağustos 2018, 21:28:33
Alıntı yapılan: Courage - 22 Ağustos 2018, 15:48:15

Merhaba arkadaşlar sunucum'da bulunan Saat&Tarih sistemini sizlere sunuyorum umarım işinize yaramıştır. Sistem roleplay sunucuları için ideal'dır, hapistey'ken /zaman yazdığınız'da kalan süreyi gösterir ayrıca sunucu içerisin'de /zaman yazdığınız'da saati ve tarihi gösterir.


CMD:zaman(playerid, params[])
{
new string[128];
    new mtext[20];
    new year, month,day;
    getdate(year, month, day);
    if(month == 1) { mtext = "Ocak"; }
    else if(month == 2) { mtext = "Subat"; }
    else if(month == 3) { mtext = "Mart"; }
    else if(month == 4) { mtext = "Nisan"; }
    else if(month == 5) { mtext = "Mayis"; }
    else if(month == 6) { mtext = "Haziran"; }
    else if(month == 7) { mtext = "Temmuz"; }
    else if(month == 8) { mtext = "Agustos"; }
    else if(month == 9) { mtext = "Eylul"; }
    else if(month == 10) { mtext = "Ekim"; }
    else if(month == 11) { mtext = "Kasim"; }
    else if(month == 12) { mtext = "Aralik"; }
    new hour,minuite,second;
    gettime(hour,minuite,second);
    FixHour(hour);
    hour = shifthour;
    if(minuite < 10)
{
        if(PlayerInfo[playerid][pJailTime] > 0)
{
            format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|~n~~w~Kalan Hapis Suresi: %d saniye", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]);
        }
        else
{
            format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|", day, mtext, hour, minuite);
        }
    }
    else
{
        if(PlayerInfo[playerid][pJailTime] > 0)
{
            format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|~n~~w~Kalan Hapis Suresi: %d saniye", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]);
        }
        else
{
            format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|", day, mtext, hour, minuite);
        }
    }
    GameTextForPlayer(playerid, string, 5000, 1);
    return 1;
}


Bunun sadece bir komuta bağlı oldiğuna eminmisin?
Başlık: Ynt: Zaman&Tarih Sistemi
Gönderen: NexoR - 22 Ağustos 2018, 22:45:54
Date Plugin (https://www.pawnoturk.com/forum/mod-galerisi/date-plugin-tarih-islemlerini-hizlica-yapin/) ile daha fazlasını yapabilirsin. Tek dezavantajı plugin olarak kullanmanızdır.
Başlık: Ynt: Zaman&Tarih Sistemi
Gönderen: Kraus - 22 Ağustos 2018, 22:49:41
Açtığınız konuda Filterscript mevcut değildir. Kullanışlı Kodlar (https://www.pawnoturk.com/forum/mod-galerisi/kullanisli-kodlar/) adlı konuya bunu atabilirsiniz.