SA-MP Forums Archive
Why this not working?? | rep++ - 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: Why this not working?? | rep++ (/showthread.php?tid=574084)



Why this not working?? | rep++ - TiXz0r - 13.05.2015

Hello, im maked this function for every 31 second check if 0 minutes, change server time to real time. but, this not working, i dont know why? any help?
timer:
Код:
SetTimer("MedServerTimer1", 31000, 1);
public:

Код:
public MedServerTimer1()
{
    new Minute;
    gettime(Minute);
    if(Minute == 0)
    {
    new Hour;
    gettime(Hour);

    SetWorldTime(Hour);

	new string[124];
    format(string, sizeof(string),""COL_LIME"[ULN]: "COL_WHITE"Now is %d hours.", Hour);
   	SendClientMessageToAll(-1,string);
    }

    return 1;
}



Re: Why this not working?? | rep++ - Dokins - 13.05.2015

pawn Код:
public MedServerTimer1()
{
    new Hour,Minute;
    gettime(Hour, Minute);
    SetWorldTime(Hour);

    new string[124];
    format(string, sizeof(string),""COL_LIME"[ULN]: "COL_WHITE"Now is %d hours.", Hour);
    SendClientMessageToAll(-1,string);

    return 1;
}
That should do it.


Re: Why this not working?? | rep++ - TiXz0r - 13.05.2015

Quote:
Originally Posted by Dokins
Посмотреть сообщение
pawn Код:
public MedServerTimer1()
{
    new Hour,Minute;
    gettime(Hour, Minute);
    SetWorldTime(Hour);

    new string[124];
    format(string, sizeof(string),""COL_LIME"[ULN]: "COL_WHITE"Now is %d hours.", Hour);
    SendClientMessageToAll(-1,string);
    }

    return 1;
}
That should do it.
What? this is not complete


Re: Why this not working?? | rep++ - Dokins - 13.05.2015

You're only displaying the hour, you don't need to check what minute it is.

EDIT: Fixed a bracket.


Re: Why this not working?? | rep++ - TiXz0r - 13.05.2015

Quote:
Originally Posted by Dokins
Посмотреть сообщение
You're only displaying the hour, you don't need to check what minute it is.

EDIT: Fixed a bracket.
but i want every full hour becouse i want make drug system when use drugs will be night to player if use drug. and this system will automatic change him to time of server


im rep+ you


Re: Why this not working?? | rep++ - Dokins - 13.05.2015

There you go.
pawn Код:
public MedServerTimer1()
{
    new Hour,Minute;
    gettime(Hour, Minute);
    if(Minute == 0)
    {
        SetWorldTime(Hour);

        new string[124];
        format(string, sizeof(string),""COL_LIME"[ULN]: "COL_WHITE"Now is %d hours.", Hour);
        SendClientMessageToAll(-1,string);
    }
    return 1;
}



Re: Why this not working?? | rep++ - TiXz0r - 13.05.2015

Im maked this now xD but thank you im rep+


do you know how to make on command /admins, sort him to from higher level to smaller level?

Код:
CMD:admins(playerid, params[])
{
 	new string[256];
 	new fstring[64];
	new adm = 0;
	
    foreach(Player, i)
    {
	    if(PlayerInfo[i][pAdmin] > 0) adm++;
		{
        if(PlayerInfo[i][pAdmin] > 0)
        {
            format(fstring, sizeof(fstring),""COL_ORANGE"%s"COL_GREY" [ID: %d] [Admin Level: %d]\n", GetName(i), i, PlayerInfo[i][pAdmin]);
            strcat(string, fstring, sizeof(string));
        }
        if(adm == 0) return SCM(playerid, COLOR_ORANGE, "[SERVER]: "COL_WHITE"Trenutno nema Admina/Gamemastera online!");
		}
    }
    ShowPlayerDialog(playerid,DIALOG_ADMINSLISTP,DIALOG_STYLE_MSGBOX,""COL_ORANGE"ONLINE ADMINS",string,"ZATVORI","");
    return 1;
}



Re: Why this not working?? | rep++ - Dokins - 13.05.2015

I would recommend you learn a little more PAWN, there are a lot of admin systems available at the moment! Good luck.