SA-MP Forums Archive
Text Draw's are not hidding/destroying - 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: Text Draw's are not hidding/destroying (/showthread.php?tid=621195)



Text Draw's are not hidding/destroying - XBoss30 - 07.11.2016

When I want to spawn I want a Text Draw to get hidden so I did this:

On top of the filterscript:
PHP Code:
new Text:XBoss30
Under public OnPlayerSpawn(playerid):
PHP Code:
public OnPlayerSpawn(playerid)
{
    
TextDrawHideForPlayer(playeridXBoss30);
    return 
1;

And under public OnGameModeInIt():
PHP Code:
 XBoss30 TextDrawCreate(641.500000449.062500"usebox");
    
TextDrawLetterSize(XBoss300.000000, -13.879164);
    
TextDrawTextSize(XBoss30, -2.0000000.000000);
    
TextDrawAlignment(XBoss301);
    
TextDrawColor(XBoss30255);
    
TextDrawUseBox(XBoss30true);
    
TextDrawBoxColor(XBoss30255);
    
TextDrawSetShadow(XBoss300);
    
TextDrawSetOutline(XBoss300);
    
TextDrawBackgroundColor(XBoss30255);
    
TextDrawFont(XBoss300);
    
TextDrawSetProportional(XBoss301); // Bottom Black Bar 
Still this TextDraw is being displayed when i run it and spawn.
Any Help? NewBie Here


Re: Text Draw's are not hidding/destroying - Magic11 - 07.11.2016

Use TextDrawShowForPlayer under OnPlayerConnect.

It should work now.


Re: Text Draw's are not hidding/destroying - XBoss30 - 08.11.2016

I'm getting a whole bunch of errors saying:
PHP Code:
error 017undefined symbol "playerid" 
and everything is set as you mentioned above, Fuuuck! [Saying this in a nice way]


Re: Text Draw's are not hidding/destroying - NaS - 08.11.2016

Quote:
Originally Posted by XBoss30
View Post
I'm getting a whole bunch of errors saying:
PHP Code:
error 017undefined symbol "playerid" 
and everything is set as you mentioned above, Fuuuck! [Saying this in a nice way]
The code made absolutely no sense.

A) There is no playerid parameter in OnGameModeInit.
B) You use a global TextDraw, not a per-player one. There is no point in using a per-player TextDraw if you want to show the same thing to everyone!

The code as such is correct! There must be a mistake somewhere else. Do you show/hide it somewhere else in the script? Does OnPlayerSpawn get called?


Re: Text Draw's are not hidding/destroying - XBoss30 - 08.11.2016

Quote:
Originally Posted by NaS
View Post
The code made absolutely no sense.

A) There is no playerid parameter in OnGameModeInit.
B) You use a global TextDraw, not a per-player one. There is no point in using a per-player TextDraw if you want to show the same thing to everyone!

The code as such is correct! There must be a mistake somewhere else. Do you show/hide it somewhere else in the script? Does OnPlayerSpawn get called?
OnPlayerSpawn does get called and that's where "TextDrawShowForPlayer(playerid, XBoss30[playerid]" is ?!
When i made textdraws i always made it like this and it worked perfectly but i don't know whats the problem now


Re: Text Draw's are not hidding/destroying - Shaheen - 08.11.2016

try this
PHP Code:
public ongamemodeinit()
    
TextDrawShowForPlayer(playeridXBoss30[playerid]); 
    return 
1
and 
on 
public  onplayerspawn(playerid)
TextDrawHideForPlayer(playerid
XBoss30
[playerid]); 
it should work..


Re: Text Draw's are not hidding/destroying - MikeB - 08.11.2016

Quote:
Originally Posted by Shaheen
View Post
try this
PHP Code:
public ongamemodeinit()
    
TextDrawShowForPlayer(playeridXBoss30[playerid]); 
    return 
1
and 
on 
public  onplayerspawn(playerid)
TextDrawHideForPlayer(playerid
XBoss30
[playerid]); 
it should work..
There's no playerid parameter on OnGameModeInit, do you have any idea of what you are doing? I guess not.


Re: Text Draw's are not hidding/destroying - Shaheen - 08.11.2016

Quote:
Originally Posted by MikeB
View Post
There's no playerid parameter on OnGameModeInit, do you have any idea of what you are doing? I guess not.
bymistake
just make it in onplayerconnect instead of ongamemodeinit


Re: Text Draw's are not hidding/destroying - XBoss30 - 08.11.2016

Quote:
Originally Posted by Shaheen
View Post
try this
PHP Code:
public ongamemodeinit()
    
TextDrawShowForPlayer(playeridXBoss30[playerid]); 
    return 
1
and 
on 
public  onplayerspawn(playerid)
TextDrawHideForPlayer(playerid
XBoss30
[playerid]); 
it should work..
Are u dumb or something? but thanks for the help. Not working


Re: Text Draw's are not hidding/destroying - Shaheen - 08.11.2016

try this
PHP Code:
public onplayerconnect
    TextDrawShowForPlayer
(playeridXBoss30[playerid]); 
    return 
1


and 
on 
public  onplayerspawn(playerid)

TextDrawHideForPlayer(playerid
XBoss30
[playerid]); 
now ??..