timer / textdraw bug
#7

Quote:
Originally Posted by Matess
Посмотреть сообщение
Well maybe because you are creating one textdraw again and again? Destroy it on disconnect or use playertextdraw.
Thank you, I will try that now and give feedback within the next 24 hours!

EDT:

It seems that now the textdraws are getting overwritten.
(take a look at the commented line)
PHP код:
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#if defined FILTERSCRIPT
new Text:TDEditor_TD[2];
forward HideDescriptionText(playerid);
forward OnPlayerHeadShot(playeridissueridFloat:amount);
public 
OnFilterScriptInit()
{
    
TDEditor_TD[0] = TextDrawCreate(402.1995844.378755"Watch_movies_online_for_free_at_movies1337.com"); //This one here is changing to [HEADSHOT]blablabla
    
TextDrawLetterSize(TDEditor_TD[0], 0.4000000.800000);
    
TextDrawAlignment(TDEditor_TD[0], 2);
    
TextDrawColor(TDEditor_TD[0], 255);
    
TextDrawSetShadow(TDEditor_TD[0], 0);
    
TextDrawSetOutline(TDEditor_TD[0], 1);
    
TextDrawBackgroundColor(TDEditor_TD[0], 16711935);
    
TextDrawFont(TDEditor_TD[0], 2);
    
TextDrawSetProportional(TDEditor_TD[0], 1);
    
TextDrawSetShadow(TDEditor_TD[0], 0);
    
TDEditor_TD[1] = TextDrawCreate(166.000000432.044494"play.bestsampserver.com:7777__/teles_/cmds_/rules");
    
TextDrawLetterSize(TDEditor_TD[1], 0.4000001.600000);
    
TextDrawAlignment(TDEditor_TD[1], 1);
    
TextDrawColor(TDEditor_TD[1], -1);
    
TextDrawSetShadow(TDEditor_TD[1], 0);
    
TextDrawSetOutline(TDEditor_TD[1], 1);
    
TextDrawBackgroundColor(TDEditor_TD[1], 255);
    
TextDrawFont(TDEditor_TD[1], 1);
    
TextDrawSetProportional(TDEditor_TD[1], 1);
    
TextDrawSetShadow(TDEditor_TD[1], 0);
    
    
TextDrawShowForAll(TDEditor_TD[0]);
    
TextDrawShowForAll(TDEditor_TD[1]);
    return 
1;
}
public 
OnFilterScriptExit()
{
    
TextDrawDestroy(TDEditor_TD[0]);
    
TextDrawDestroy(TDEditor_TD[1]);
    return 
1;
}
#else
main()
{
}
#endif
public OnGameModeInit()
{
    return 
1;
}
public 
OnGameModeExit()
{
    return 
1;
}
public 
OnPlayerRequestClass(playeridclassid)
{
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    
TextDrawShowForAll(TDEditor_TD[0]);
    
TextDrawShowForAll(TDEditor_TD[1]);
    return 
1;

PS. I think this might be because ongamemodeexit(I used gmx because high player count) there's no code reseting the variable that stores the textdraw so one of the player's must have the ID of the textdraw TDEditor_TD[0].

No big deal if that's the case, I'll just reset everyone's textdraw variable.
Reply


Messages In This Thread
[+REP] timer / textdraw bug - by Aasim - 17.01.2015, 10:52
Re: timer / textdraw bug - by Aasim - 18.01.2015, 13:03
Re: timer / textdraw bug - by Aasim - 19.01.2015, 13:01
Re: timer / textdraw bug - by Rudy_ - 19.01.2015, 13:20
Re: timer / textdraw bug - by Aasim - 19.01.2015, 13:49
Re: timer / textdraw bug - by Matess - 19.01.2015, 14:20
Re: timer / textdraw bug - by Aasim - 19.01.2015, 14:42

Forum Jump:


Users browsing this thread: 1 Guest(s)