SA-MP Forums Archive
How can i disable it? - 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: How can i disable it? (/showthread.php?tid=659731)



How can i disable it? - oghabanjb - 14.10.2018

Hi all.

When i type "/Time" i see this:


(if u dont see the image see this link: "https://imgur.com/W6NsODN")

How can i disable it?


Re: How can i disable it? - Boarden - 14.10.2018

Assuming you're just talking about the text in the corner, remove the "GameTextForPlayer" line in the command (along with any strings that were used to display the text, if you no longer want to use that text).


Re: How can i disable it? - oghabanjb - 14.10.2018

this is my code:

PHP код:
CMD:time(playerid,params[])
{
    new 
input_time;
    if (
sscanf(params"i"input_time))
    {
        return 
ShowPlayerDialog(playerid,DIALOG_TIME,DIALOG_STYLE_LIST,"{00FF00}Time","0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23","Ok","Cancel");
    }
    else
    {
        if(
input_time 23 || input_time 0) return GameTextForPlayer(playerid,"~g~Time ~w~(0 - 23)",5000,3);
        
SetPlayerTime(playerid,input_time,0);
        
SendClientMessage(playerid,green,"Time changed");
        
time[playerid] = input_time;
    }
    return 
1;




Re: How can i disable it? - KinderClans - 14.10.2018

Quote:
Originally Posted by Boarden
Посмотреть сообщение
Assuming you're just talking about the text in the corner, remove the "GameTextForPlayer" line in the command (along with any strings that were used to display the text, if you no longer want to use that text).
Check his screen, it shows 17:6 which is not a correct time format (12/24 hours).

@OP, try this:

pawn Код:
CMD:time(playerid, params[])
{
    new string[128], hour, minute, seconds;

    gettime(hour, minute, seconds);
   
    format(string, sizeof(string), "~g~|~w~%02d:%02d~g~|", hour, minute);

    GameTextForPlayer(playerid, string, 2000, 1);
    return 1;
}
And edit it according to your time command.


Re: How can i disable it? - Boarden - 14.10.2018

Quote:
Originally Posted by KinderClans
Посмотреть сообщение
Check his screen, it shows 17:6 which is not a correct time format (12/24 hours).
I saw that however, asking to "disable it" doesn't exactly make it clear that he wants the code fixing and not outright removed. Regardless the above code seems like it would work.