15.07.2016, 13:09
Hey guys,
this is the first time I am asking for help here and I hope you guys are able to, because this bug is pretty annoying.
I have a few Textdraws in my gamemode and they're usually working well till I make a relog.
Here are a few Screenshots:
http://imgur.com/OlLKRdP
http://imgur.com/p5GqRR6
Also, here a video:
https://www.youtube.com/watch?v=TlH61vXuCzU
Let's talk about the Code:
95 % of my textdraws are located in an extra file called texts.pwn which is included into the main gamemode.
I am destroying all Textdraws on OnGameModeExit & OnPlayerDisconnect.
This is how my code looks like
OnPlayerDisconnect
They're destroyed like this (not going to post all except if it's necessary):
(Don't know why I am hiding them before destroying, thought it might help)
Hope you guys can help me..
this is the first time I am asking for help here and I hope you guys are able to, because this bug is pretty annoying.
I have a few Textdraws in my gamemode and they're usually working well till I make a relog.
Here are a few Screenshots:
http://imgur.com/OlLKRdP
http://imgur.com/p5GqRR6
Also, here a video:
https://www.youtube.com/watch?v=TlH61vXuCzU
Let's talk about the Code:
95 % of my textdraws are located in an extra file called texts.pwn which is included into the main gamemode.
I am destroying all Textdraws on OnGameModeExit & OnPlayerDisconnect.
This is how my code looks like
Код HTML:
//Player ProgressBar new PlayerBar:Bar0[MAX_PLAYERS] = {INVALID_PLAYER_BAR_ID}; new PlayerBar:Bar1[MAX_PLAYERS] = {INVALID_PLAYER_BAR_ID}; new PlayerBar:Bar2[MAX_PLAYERS] = {INVALID_PLAYER_BAR_ID}; new PlayerBar:Bar3[MAX_PLAYERS] = {INVALID_PLAYER_BAR_ID}; new PlayerBar:Bar4[MAX_PLAYERS] = {INVALID_PLAYER_BAR_ID}; new PlayerBar:PB[MAX_PLAYERS] = {INVALID_PLAYER_BAR_ID}; // Player Textdraws new PlayerText:Arrow[MAX_PLAYERS][5] = {PlayerText:INVALID_TEXT_DRAW, ...}; new PlayerText:EXPSkillCount[MAX_PLAYERS][5] = {PlayerText:INVALID_TEXT_DRAW, ...}; new PlayerText:SkillTD[MAX_PLAYERS][6] = {PlayerText:INVALID_TEXT_DRAW, ...}; new PlayerText:RoundStatsString[MAX_PLAYERS][11] = {PlayerText:INVALID_TEXT_DRAW, ...}; new PlayerText:WeedTexts[MAX_PLAYERS][4] = {PlayerText:INVALID_TEXT_DRAW, ...}; new PlayerText:SpreeT[MAX_PLAYERS][2] = {PlayerText:INVALID_TEXT_DRAW, ...}; new PlayerText:PlayerKill[MAX_PLAYERS][2] = {PlayerText:INVALID_TEXT_DRAW, ...}; new PlayerText:MultiKill[MAX_PLAYERS][2] = {PlayerText:INVALID_TEXT_DRAW, ...}; new PlayerText:SpecText[MAX_PLAYERS][4] = {PlayerText:INVALID_TEXT_DRAW, ...}; new PlayerText:ExpTexts[MAX_PLAYERS][2] = {PlayerText:INVALID_TEXT_DRAW, ...}; new PlayerText:SBText[MAX_PLAYERS][4] = {PlayerText:INVALID_TEXT_DRAW, ...}; new PlayerText:PlayerMainText1[MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...}; new PlayerText:PlayerMainText2[MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...}; new PlayerText:PlayerMainText3[MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...}; new PlayerText:PlayerMainText4[MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...};
Код HTML:
DestroyRegisterTextdraws(playerid); DestroyWeedTextDraws(playerid); DestroyRoundStatsTextDraws(playerid); DestroyPlayerKillTextDraws(playerid); DestroyMultiKillTextDraws(playerid); DestroySpreeTextDraws(playerid); DestroySkillTextDraw(playerid); DestroySkillBar(playerid); DestroyEXPSkillCount(playerid); DestroyArrows(playerid); Destroy******TextDraws(playerid); DestroyEXPBar(playerid); DestroyWatchTexts(playerid); DestroyMainText(playerid);
(Don't know why I am hiding them before destroying, thought it might help)
Код HTML:
DestroyArrows(playerid) { PlayerTextDrawHide(playerid,Arrow[playerid][0]); PlayerTextDrawHide(playerid,Arrow[playerid][1]); PlayerTextDrawHide(playerid,Arrow[playerid][2]); PlayerTextDrawHide(playerid,Arrow[playerid][3]); PlayerTextDrawHide(playerid,Arrow[playerid][4]); PlayerTextDrawDestroy(playerid,Arrow[playerid][0]); PlayerTextDrawDestroy(playerid,Arrow[playerid][1]); PlayerTextDrawDestroy(playerid,Arrow[playerid][2]); PlayerTextDrawDestroy(playerid,Arrow[playerid][3]); PlayerTextDrawDestroy(playerid,Arrow[playerid][4]); Arrow[5][playerid] = PlayerText:INVALID_TEXT_DRAW; }
Код HTML:
DestroyMainText(playerid) { PlayerTextDrawDestroy(playerid, PlayerMainText1[playerid]); PlayerTextDrawDestroy(playerid, PlayerMainText2[playerid]); PlayerTextDrawDestroy(playerid, PlayerMainText3[playerid]); PlayerTextDrawDestroy(playerid, PlayerMainText4[playerid]); PlayerMainText1[playerid] = PlayerText:INVALID_TEXT_DRAW; PlayerMainText2[playerid] = PlayerText:INVALID_TEXT_DRAW; PlayerMainText3[playerid] = PlayerText:INVALID_TEXT_DRAW; PlayerMainText4[playerid] = PlayerText:INVALID_TEXT_DRAW; }
Код HTML:
DestroyRoundStatsTextDraws(playerid) { PlayerTextDrawHide(playerid, RoundStatsString[playerid][0]); PlayerTextDrawHide(playerid, RoundStatsString[playerid][1]); PlayerTextDrawHide(playerid, RoundStatsString[playerid][2]); PlayerTextDrawHide(playerid, RoundStatsString[playerid][3]); PlayerTextDrawHide(playerid, RoundStatsString[playerid][4]); PlayerTextDrawHide(playerid, RoundStatsString[playerid][5]); PlayerTextDrawHide(playerid, RoundStatsString[playerid][6]); PlayerTextDrawHide(playerid, RoundStatsString[playerid][7]); PlayerTextDrawHide(playerid, RoundStatsString[playerid][8]); PlayerTextDrawHide(playerid, RoundStatsString[playerid][9]); PlayerTextDrawHide(playerid, RoundStatsString[playerid][10]); PlayerTextDrawDestroy(playerid, RoundStatsString[playerid][0]); PlayerTextDrawDestroy(playerid, RoundStatsString[playerid][1]); PlayerTextDrawDestroy(playerid, RoundStatsString[playerid][2]); PlayerTextDrawDestroy(playerid, RoundStatsString[playerid][3]); PlayerTextDrawDestroy(playerid, RoundStatsString[playerid][4]); PlayerTextDrawDestroy(playerid, RoundStatsString[playerid][5]); PlayerTextDrawDestroy(playerid, RoundStatsString[playerid][6]); PlayerTextDrawDestroy(playerid, RoundStatsString[playerid][7]); PlayerTextDrawDestroy(playerid, RoundStatsString[playerid][8]); PlayerTextDrawDestroy(playerid, RoundStatsString[playerid][9]); PlayerTextDrawDestroy(playerid, RoundStatsString[playerid][10]); RoundStatsString[11][playerid] = PlayerText:INVALID_TEXT_DRAW; }