Little Help
#1

Hello, my current issue is that when I spawn for the first time textdraw appears, from 0 to 31, but when I die and respawn only textdraw with ID 0 is not showed, I don`t understand why, I did debug on whole for loop which is showing my textdraws and it was correct without any bug... Here is the code:
PHP код:
stock ShowGraphicalUserInterface(playerid)
{
    for(new 
032i++)
    {
        
PlayerTextDrawShow(playeridGUI[playerid][i]);
        
printf("i:%d"i);
         }
         return 
1;

Here is log print:
Код:
[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
But textdraw with ID 0 is still not showing, here is OnPlayerSpawn callback:
PHP код:
public OnPlayerSpawn(playerid)
{
    
DestroyTeamSelectionTD(playerid);
    
    
SetPlayerColor(playerid,TeamInfo[pTeam[playerid]][TeamColor]);
    
    if(
pClass[playerid] == INVALID_CLASSShowClassDialog(playerid);
    else
    {
        
ShowGraphicalUserInterface(playerid);
        
GiveClassWeapons(playerid);
    }
    if(
pInfo[playerid][pVip] == 1SetPlayerArmour(playerid100);
    else 
SetPlayerArmour(playerid50);
    return 
1;

Reply
#2

PHP код:
stock ShowGraphicalUserInterface(playerid

    for(new 
032i++) 
    { 
        
PlayerTextDrawShow(playeridGUI[playerid][i]); 
    } 

Give a try to that and make sure the TextDraw isn't getting destroyed while playing.
Reply
#3

Quote:
Originally Posted by RIDE2DAY
Посмотреть сообщение
PHP код:
stock ShowGraphicalUserInterface(playerid

    for(new 
032i++) 
    { 
        
PlayerTextDrawShow(playeridGUI[playerid][i]); 
    } 

Give a try to that and make sure the TextDraw isn't getting destroyed while playing.
Same bug. I checked twice but everything seems fine...
Reply
#4

You have to save per-player textdraws in OnPlayerConnect..
Reply
#5

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.
Reply
#6

Quote:
Originally Posted by Kaperstone
Посмотреть сообщение
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?
Reply
#7

Quote:
Originally Posted by Sanady
Посмотреть сообщение
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).
Reply
#8

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
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).
I know that there must be reason, but still I don`t understand why is it happening, I debuged whole textdraw script but it seems ok, I will try that with timer I forget about that solution.
Reply
#9

Have you tried making empty textdraw to take over id 0?
like
PHP код:
CreatePlayerTextDraw(playerid,  00" ");
//.. then make your textdraws 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)