Issue with /time command.
#7

Freaksken solved the issue with me through Discord. If anyone else faces this problem, you need to make a player textdraw. I suggest following Freaksken's guide which you can find here. https://sampforum.blast.hk/showthread.php?tid=625685

This is the code I have now, that fixed it.

PHP код:
new PlayerText:InfoText[MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...}, DisplayingText[MAX_PLAYERS], TextTiming[MAX_PLAYERS], AnimTiming[MAX_PLAYERS];
stock CreateInfoTextDraw(playerid)
{
    
InfoText[playerid] = CreatePlayerTextDraw(playerid319.000000380.000000"");
    
PlayerTextDrawAlignment(playeridInfoText[playerid], 2);
    
PlayerTextDrawBackgroundColor(playeridInfoText[playerid], 255);
    
PlayerTextDrawFont(playeridInfoText[playerid], 1);
    
PlayerTextDrawLetterSize(playeridInfoText[playerid], 0.3200001.500000);
    
PlayerTextDrawSetProportional(playeridInfoText[playerid], 1);
    
PlayerTextDrawSetShadow(playeridInfoText[playerid], 1);
}
stock DisplayInfoTextDraw(playeridstr[], duration)
{
    if(
DisplayingText[playerid])
    {
        
KillTimer(TextTiming[playerid]);
    }
    
PlayerTextDrawSetString(playeridInfoText[playerid], str);
    
PlayerTextDrawShow(playeridInfoText[playerid]);
    
TextTiming[playerid] = SetTimerEx("HideInfoTextDraw"duration *10000"i"playerid);
    
AnimTiming[playerid] = SetTimerEx("AnimTimer"2000false"i"playerid);
    
DisplayingText[playerid] = 1;
    return 
1;
}
forward HideInfoTextDraw(playerid);
public 
HideInfoTextDraw(playerid)
{
    
PlayerTextDrawHide(playeridInfoText[playerid]);
    
DisplayingText[playerid] = 0;
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    
CreateInfoTextDraw(playerid);
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    
DisplayingText[playerid] = 0;
    
InfoText[playerid] = PlayerText:INVALID_TEXT_DRAW;
    return 
1;

Reply


Messages In This Thread
Issue with /time command. - by Stefhan - 10.04.2019, 21:32
Re: Issue with /time command. - by Freaksken - 10.04.2019, 21:59
Re: Issue with /time command. - by Stefhan - 10.04.2019, 22:02
Re: Issue with /time command. - by Freaksken - 10.04.2019, 22:06
Re: Issue with /time command. - by Stefhan - 10.04.2019, 22:08
Re: Issue with /time command. - by Freaksken - 10.04.2019, 22:16
Re: Issue with /time command. - by Stefhan - 11.04.2019, 21:29

Forum Jump:


Users browsing this thread: 1 Guest(s)