Text Draw's are not hidding/destroying
#1

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
Reply
#2

Use TextDrawShowForPlayer under OnPlayerConnect.

It should work now.
Reply
#3

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]
Reply
#4

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?
Reply
#5

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

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

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

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
Reply
#9

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
Reply
#10

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


and 
on 
public  onplayerspawn(playerid)

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


Forum Jump:


Users browsing this thread: 1 Guest(s)