TextDrawShowForPlayer under OnPlayerSpawn
#1

public OnPlayerSpawn(playerid) ------ > TextDrawHideForPlayer(playerid, TDNews1);

This happened suddenly, when player spawn's, the textdraw doesn't go away! How can this be, it worked before?

PS. Mistake on topic's title.
Reply
#2

try puting TextDrawHideForPlayer(playerid, TDNews1); at the top of OnPlayerSpawn.
Reply
#3

I don't know how you set it up but, the way I did is:
I setup the textdraw name on top

pawn Код:
new Text:TDNews1; // In your case
Then on public OnGameModeInit() I set up the way the textdraw is going to look.

pawn Код:
public OnGameModeInit()
{
    TDNews1 = TextDrawCreate(400,400, "Text");
    // Your textdraw settings
    return 1;
}
Then add TextDrawShowForPlayer(playerid, TDNews1); on public OnPlayerConnect(playerid)

pawn Код:
public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid, TDNews1);
    return 1;
}
And finally on public OnPlayerSpawn(playerid) add TextDrawHideForPlayer(playerid, TDNews1);

pawn Код:
public OnPlayerSpawn(playerid)
{
    TextDrawHideForPlayer(playerid, TDNews1);
    return 1;
}
If this doesn't fix your problem, make sure you don't have two textdraws with the same name or try checking new stuff you've added.

Hope this helped you,
DC
Reply
#4

Quote:
Originally Posted by MeDaKewlDude
Посмотреть сообщение
try puting TextDrawHideForPlayer(playerid, TDNews1); at the top of OnPlayerSpawn.
Thanks, it worked.

But why is it like that? OnGamemodeInit was the same thing, it didnt read my function, until i moved it upwards...
Reply
#5

Quote:
Originally Posted by ddnbb
Посмотреть сообщение
Thanks, it worked.

But why is it like that? OnGamemodeInit was the same thing, it didnt read my function, until i moved it upwards...
Maybe your code have some "hidden" errors, try to use crash detect, or maybe you use returns bad in your callbacks.
Reply
#6

maybe somewhere above where you had it, it returned 1 and stopped the script
Reply
#7

Quote:
Originally Posted by MeDaKewlDude
Посмотреть сообщение
maybe somewhere above where you had it, it returned 1 and stopped the script
No i checked, i made some prints and it stops at weird place, but it should not! Crash detect huh?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)