stock ShowGraphicalUserInterface(playerid)
{
for(new i = 0; i < 32; i++)
{
PlayerTextDrawShow(playerid, GUI[playerid][i]);
printf("i:%d", i);
}
return 1;
}
[12:37:53] i:0 [12:37:53] i:1 [12:37:53] i:2 [12:37:53] i:3 [12:37:53] i:4 [12:37:53] i:5 [12:37:53] i:6 [12:37:53] i:7 [12:37:53] i:8 [12:37:53] i:9 [12:37:53] i:10 [12:37:53] i:11 [12:37:53] i:12 [12:37:53] i:13 [12:37:53] i:14 [12:37:53] i:15 [12:37:53] i:16 [12:37:53] i:17 [12:37:53] i:18 [12:37:53] i:19 [12:37:53] i:20 [12:37:53] i:21 [12:37:53] i:22 [12:37:53] i:23 [12:37:53] i:24 [12:37:53] i:25 [12:37:53] i:26 [12:37:53] i:27 [12:37:53] i:28 [12:37:53] i:29 [12:37:53] i:30 [12:37:53] i:31
public OnPlayerSpawn(playerid)
{
DestroyTeamSelectionTD(playerid);
SetPlayerColor(playerid,TeamInfo[pTeam[playerid]][TeamColor]);
if(pClass[playerid] == INVALID_CLASS) ShowClassDialog(playerid);
else
{
ShowGraphicalUserInterface(playerid);
GiveClassWeapons(playerid);
}
if(pInfo[playerid][pVip] == 1) SetPlayerArmour(playerid, 100);
else SetPlayerArmour(playerid, 50);
return 1;
}
stock ShowGraphicalUserInterface(playerid)
{
for(new i = 0; i < 32; i++)
{
PlayerTextDrawShow(playerid, GUI[playerid][i]);
}
}
PHP код:
|
I think its something in the way you assign the textdraw id that is returned from CreateTextDraw to the variable.
Make sure you have an extra slot in the GUI variable for the \0 and look if you save to the variable twice somewhere, clearing the first index by mistake or changing its value. If so what, try to skip index 0 and work with 1-32. |
I tried your solution for my issue, but still same textdraw is disappearing... First textdraw, no matter if it is ID 0 or ID 1, it will disappear after first respawn... Any other solution?
![]() |
go under OnPlayerSpawn and set a timer of 2-3 seconds to show the textdraw again or re-create it if it got destroyed for some reason. (not a solid solution there must be an actual reason behind why it keeps disappearing).
|
CreatePlayerTextDraw(playerid, 0, 0, " ");
//.. then make your textdraws