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(playerid, XBoss30);
return 1;
}
And under public OnGameModeInIt():
PHP Code:
XBoss30 = TextDrawCreate(641.500000, 449.062500, "usebox");
TextDrawLetterSize(XBoss30, 0.000000, -13.879164);
TextDrawTextSize(XBoss30, -2.000000, 0.000000);
TextDrawAlignment(XBoss30, 1);
TextDrawColor(XBoss30, 255);
TextDrawUseBox(XBoss30, true);
TextDrawBoxColor(XBoss30, 255);
TextDrawSetShadow(XBoss30, 0);
TextDrawSetOutline(XBoss30, 0);
TextDrawBackgroundColor(XBoss30, 255);
TextDrawFont(XBoss30, 0);
TextDrawSetProportional(XBoss30, 1); // 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 017: undefined 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
I'm getting a whole bunch of errors saying:
PHP Code:
error 017: undefined 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
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(playerid, XBoss30[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
try this
PHP Code:
public ongamemodeinit()
TextDrawShowForPlayer(playerid, XBoss30[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
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
try this
PHP Code:
public ongamemodeinit()
TextDrawShowForPlayer(playerid, XBoss30[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(playerid, XBoss30[playerid]);
return 1;
and on
public onplayerspawn(playerid)
TextDrawHideForPlayer(playerid
XBoss30[playerid]);
now ??..