Jump to content
  • 0

Ora 00:00


TheGodfather

Question

Salut, vreau ca la functia payday, cand e ora 00:00 sa faca ceva. Am incercat mai multe variante dar nu merge verificarea pentru ora 00:00. Imi actualizeaza orele indiferent de ce ora e.

function PayDay(bool: Types) {
    
    new hour,minn,sec, year, month, day, Interestt, rent; gString[0] = EOS;
    getdate(year, month, day);
    gettime(hour,minn,sec);
    if((minn == 0 && Paydaydat == 0) || Types) {
        defer ResetPD();
        Paydaydat = 1;
        defer ScadeLicentele();
        if(hour == 0 && minn == 0) {
            foreach(PersonalVehicles, idd) CarInfo[idd][Dayss] ++;
            new queryy[128];
            mysql_format(SQL, queryy, sizeof(queryy), "UPDATE `cars` SET `days`=`days`+1");
            mysql_tquery(SQL, queryy, "", "");
            mysql_format(SQL, queryy, sizeof(queryy), "UPDATE `users` SET `Days`=`Days`+1 WHERE `Member`>'0'");
            mysql_tquery(SQL, queryy, "", "");
            mysql_format(SQL, queryy, sizeof(queryy), "UPDATE `users` SET `ClanDayss`=`ClanDayss`+1 WHERE `Clan`>'0'");
            mysql_tquery(SQL, queryy, "", "");
        }

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0
15 hours ago, TheGodfather said:

Salut, vreau ca la functia payday, cand e ora 00:00 sa faca ceva. Am incercat mai multe variante dar nu merge verificarea pentru ora 00:00. Imi actualizeaza orele indiferent de ce ora e.

function PayDay(bool: Types) {
    
    new hour,minn,sec, year, month, day, Interestt, rent; gString[0] = EOS;
    getdate(year, month, day);
    gettime(hour,minn,sec);
    if((minn == 0 && Paydaydat == 0) || Types) {
        defer ResetPD();
        Paydaydat = 1;
        defer ScadeLicentele();
        if(hour == 0 && minn == 0) {
            foreach(PersonalVehicles, idd) CarInfo[idd][Dayss] ++;
            new queryy[128];
            mysql_format(SQL, queryy, sizeof(queryy), "UPDATE `cars` SET `days`=`days`+1");
            mysql_tquery(SQL, queryy, "", "");
            mysql_format(SQL, queryy, sizeof(queryy), "UPDATE `users` SET `Days`=`Days`+1 WHERE `Member`>'0'");
            mysql_tquery(SQL, queryy, "", "");
            mysql_format(SQL, queryy, sizeof(queryy), "UPDATE `users` SET `ClanDayss`=`ClanDayss`+1 WHERE `Clan`>'0'");
            mysql_tquery(SQL, queryy, "", "");
        }

la timerul unde verifica payday-ul adaugi aceasta verificare: 

if(hours == 0 && minutes == 0 && seconds == 0) doispefix();

iar in gm unde vrei tu adaugi stock-ul doispefix: 

stock doispefix()
{
    // aici scrii ce vrei sa se intample
	return true;
}

 

YouTube : Click

Discord : CosminAK47#8524

Link to comment
Share on other sites

  • 0

Asa am facut payday-ul:

task givepayday[5000]() {
    PayDay(false);
}

Si dupa functia de payday, acolo e o verificare, am incercat eu sa vad daca merge si merge. Acolo unde e if(hour == 12 && minn == 0) { daca ora de la server e 12:00, doar atunci imi mareste zilele, cum si vreau de altfel. Dar daca in loc de 12 pun 0 sau 00, imi da la fiecare payday. Trebuie pus 24 sau alt numar?

function PayDay(bool: Types) {
    
    new hour,minn,sec, year, month, day, Interestt, rent; gString[0] = EOS;
    getdate(year, month, day);
    gettime(hour,minn,sec);
    if((minn == 0 && Paydaydat == 0) || Types) {
        defer ResetPD();
        Paydaydat = 1;
        defer ScadeLicentele();
        if(hour == 12 && minn == 0) {
            foreach(PersonalVehicles, idd) CarInfo[idd][Dayss] ++;
            new queryy[128];
            mysql_format(SQL, queryy, sizeof(queryy), "UPDATE `cars` SET `days`=`days`+1");
            mysql_tquery(SQL, queryy, "", "");
            mysql_format(SQL, queryy, sizeof(queryy), "UPDATE `users` SET `Days`=`Days`+1 WHERE `Member`>'0'");
            mysql_tquery(SQL, queryy, "", "");
            mysql_format(SQL, queryy, sizeof(queryy), "UPDATE `users` SET `ClanDayss`=`ClanDayss`+1 WHERE `Clan`>'0'");
            mysql_tquery(SQL, queryy, "", "");
        }

EDIT: nu mai merge nici cu 12, tot prea multe zile arata.

Edited by TheGodfather
Link to comment
Share on other sites

  • 0
14 hours ago, TheGodfather said:

up

Bro, ai defer ResetPD(); scoate asta si vezi dupa.

Si la if(hour == 12 && minn == 0) scoate 12 si lasa 0.

Ce inseamna cuvantul "Unic" este atunci cand Chestia / Obiectul / Idea / etc... nu exista in alta parte.

Copii, nu mai veniti cu vorbe de "Am gamemode unic", nu exista asa ceva, la ora actuala totul este pe net.

Aveti grija pe cine ajutati, majoritatea sunt caini.

Link to comment
Share on other sites

  • 0

 

19 hours ago, TheGodfather said:

up

Uite incearca asa sa vezi daca iti merge.

 

new Paydayhad;
CMD:test() PayDay();

CMD:test2() Paydayhad = 0;

function PayDay()
{
	new hour, minn, sec;
	gettime(hour, minn, sec);
	if(minn == 0 && Paydayhad == 0)
	{
		if(Paydayhad == 0) return Paydayhad = 1, SendClientMessageToAll(-1, "Ai primit payday.");
		if(Paydayhad == 1) return SendClientMessageToAll(-1, "Ai primit deja payday-ul ce mai vrei ?.");
	}
	return 1;
}

 

Edited by StrikerM

Ce inseamna cuvantul "Unic" este atunci cand Chestia / Obiectul / Idea / etc... nu exista in alta parte.

Copii, nu mai veniti cu vorbe de "Am gamemode unic", nu exista asa ceva, la ora actuala totul este pe net.

Aveti grija pe cine ajutati, majoritatea sunt caini.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.