Textdraw issues
#1

I have a textdraw that is meant to be seen only when entered in a certain checkpoint.


Most of the time it works perfectly, but a lot of times players can see the textdraw when they die and respawn...why is that?

Here's my textdraw:

Код:
		Textdraw0 = TextDrawCreate(351.000000, 198.000000, "/buyheal - To Heal Yourself ($1000) /Buycure - To Cure Yourself ($4500) /healall - To heal/Cure Yourself ($5000)");
		TextDrawBackgroundColor(Textdraw0, 255);
		TextDrawFont(Textdraw0, 2);
		TextDrawLetterSize(Textdraw0, 0.360000, 1.500000);
		TextDrawColor(Textdraw0, 16777215);
		TextDrawSetOutline(Textdraw0, 0);
		TextDrawSetProportional(Textdraw0, 1);
		TextDrawSetShadow(Textdraw0, 1);
		TextDrawUseBox(Textdraw0, 1);
		TextDrawBoxColor(Textdraw0, 255);
		TextDrawTextSize(Textdraw0, 644.000000, 1377.000000);
I have this:

Код:
TextDrawHideForPlayer(playerid, Textdraw0);
On

Onplayerconnect
Onplayerspawn
Onplayerdeath

On my /kill command

and when a player leaves the checkpoint that shows the textdraw in the first place.


Even though i did all this, it still shows up a large percentage of the time randomly when i die, or spawn, etc
Reply
#2

Weird, do you have any other textdraws under the same name?
Reply
#3

Quote:
Originally Posted by [HiC
TheKiller ]
Weird, do you have any other textdraws under the same name?
That's the only textdraw in my whole script.
Reply
#4

This is how i added it for my checkpoint.


Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
		Textdraw0 = TextDrawCreate(351.000000, 198.000000, "/buyheal - To Heal Yourself ($1000) /Buycure - To Cure Yourself ($4500) /healall - To heal/Cure Yourself ($5000)");
		TextDrawBackgroundColor(Textdraw0, 255);
		TextDrawFont(Textdraw0, 2);
		TextDrawLetterSize(Textdraw0, 0.360000, 1.500000);
		TextDrawColor(Textdraw0, 16777215);
		TextDrawSetOutline(Textdraw0, 0);
		TextDrawSetProportional(Textdraw0, 1);
		TextDrawSetShadow(Textdraw0, 1);
		TextDrawUseBox(Textdraw0, 1);
		TextDrawBoxColor(Textdraw0, 255);
		TextDrawTextSize(Textdraw0, 644.000000, 1377.000000);

    if (gCheckpoint[18] == checkpointid) {
    TextDrawShowForPlayer(playerid, Textdraw0);
 	}
return 1;
}
And for onplayerleavecheckpoint its


Код:
	else if (gCheckpoint[18] == checkpointid) {
	TextDrawHideForPlayer(playerid, Textdraw0);
	}
Reply
#5

Quote:
Originally Posted by [ĦŁ₣
ЉǾǖŦĦЗŁΛẄ ]
Try creating the textdraw on OnGameModeInit then showing it on checkpoint hiding it on everything else.

otherwise you are creating a textdraw every time any player enters any checkpoint.
If i do that, it shows as i connect
Reply
#6

Quote:
Originally Posted by MWF2
Quote:
Originally Posted by [ĦŁ₣
ЉǾǖŦĦЗŁΛẄ ]
Try creating the textdraw on OnGameModeInit then showing it on checkpoint hiding it on everything else.

otherwise you are creating a textdraw every time any player enters any checkpoint.
If i do that, it shows as i connect
If it does then hide it upon connect

pawn Код:
public OnPlayerConnect(playerid)
{
  TextDrawHideForPlayer(playerid, Text:Textdraw0);
  return 1;
}
Reply
#7

that didn't work either!

First time i use textdraws and I'm having all these problems. I can't seem to figure out whats wrong.

This is what happens:

I turn on my server, go on. Onplayerconnect it doesn't show. But when i spawn with my skin, the textdraw shows. It doesn't go away at all.


Heres what i have:

pawn Код:
new Text:Textdraw0;
pawn Код:
public OnGameModeInit()
{
        Textdraw0 = TextDrawCreate(351.000000, 198.000000, "/buyheal - To Heal Yourself ($1000) /Buycure - To Cure Yourself ($4500) /healall - To heal/Cure Yourself ($5000)");
        TextDrawBackgroundColor(Textdraw0, 255);
        TextDrawFont(Textdraw0, 2);
        TextDrawLetterSize(Textdraw0, 0.360000, 1.500000);
        TextDrawColor(Textdraw0, 16777215);
        TextDrawSetOutline(Textdraw0, 0);
        TextDrawSetProportional(Textdraw0, 1);
        TextDrawSetShadow(Textdraw0, 1);
        TextDrawUseBox(Textdraw0, 1);
        TextDrawBoxColor(Textdraw0, 255);
        TextDrawTextSize(Textdraw0, 644.000000, 1377.000000);
    return 1;
}
pawn Код:
public OnPlayerConnect(playerid)
{
  TextDrawHideForPlayer(playerid, Text:Textdraw0);
    return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
  TextDrawHideForPlayer(playerid, Text:Textdraw0);
    return 1;
}
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  TextDrawHideForPlayer(playerid, Text:Textdraw0);
    return 1;
}
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if (gCheckpoint[18] == checkpointid) {
    TextDrawShowForPlayer(playerid, Textdraw0);
    }
return 1;
}

public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
if (gCheckpoint[18] == checkpointid) {
    TextDrawHideForPlayer(playerid, Text:Textdraw0);
    }
    return 1;
}
Reply
#8

Quote:
Originally Posted by [ĦŁ₣
ЉǾǖŦĦЗŁΛẄ ]
Take away the 'Text:' tag from everything except the declaration: 'new Text:textdraw0'
I did that, Same problem.


Reply
#9

Bump, anyone?
Reply
#10

Please help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)