SA-MP Forums Archive
TextDrawShowForPlayer under OnPlayerSpawn - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: TextDrawShowForPlayer under OnPlayerSpawn (/showthread.php?tid=368459)



TextDrawShowForPlayer under OnPlayerSpawn - ddnbb - 13.08.2012

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.


Re: TextDrawShowForPlayer under OnPlayerSpawn - MeDaKewlDude - 13.08.2012

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


Re: TextDrawShowForPlayer under OnPlayerSpawn - D1driverGP - 13.08.2012

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


Re: TextDrawShowForPlayer under OnPlayerSpawn - ddnbb - 13.08.2012

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...


Re: TextDrawShowForPlayer under OnPlayerSpawn - IstuntmanI - 13.08.2012

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.


Re: TextDrawShowForPlayer under OnPlayerSpawn - MeDaKewlDude - 13.08.2012

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


Re: TextDrawShowForPlayer under OnPlayerSpawn - ddnbb - 13.08.2012

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?