Textdraw doesn't show on spawn sometimes it even doesn't show
#1

Full code :

Код:
new Text:Kraunasi0;
new Text:Kraunasi1;
new Text:Kraunasi2;
new Text:Kraunasi3;
new Text:Kraunasi4;
Код:
	Kraunasi0 = TextDrawCreate(401.333343, 152.077774, "usebox");
	TextDrawLetterSize(Kraunasi0, 0.000000, 7.149999);
	TextDrawTextSize(Kraunasi0, 251.000000, 0.000000);
	TextDrawAlignment(Kraunasi0, 1);
	TextDrawColor(Kraunasi0, 0);
	TextDrawUseBox(Kraunasi0, true);
	TextDrawBoxColor(Kraunasi0, 102);
	TextDrawSetShadow(Kraunasi0, 0);
	TextDrawSetOutline(Kraunasi0, 0);
	TextDrawFont(Kraunasi0, 0);

	Kraunasi1 = TextDrawCreate(287.333496, 149.748123, "~y~Kraunami Objektai");
	TextDrawLetterSize(Kraunasi1, 0.289999, 1.662222);
	TextDrawAlignment(Kraunasi1, 1);
	TextDrawColor(Kraunasi1, -1);
	TextDrawSetShadow(Kraunasi1, 0);
	TextDrawSetOutline(Kraunasi1, 1);
	TextDrawBackgroundColor(Kraunasi1, 51);
	TextDrawFont(Kraunasi1, 0);
	TextDrawSetProportional(Kraunasi1, 1);

	Kraunasi2 = TextDrawCreate(280.333282, 165.096328, "~g~Prasome Palaukti");
	TextDrawLetterSize(Kraunasi2, 0.389000, 1.550222);
	TextDrawAlignment(Kraunasi2, 1);
	TextDrawColor(Kraunasi2, -1);
	TextDrawSetShadow(Kraunasi2, 0);
	TextDrawSetOutline(Kraunasi2, 1);
	TextDrawBackgroundColor(Kraunasi2, 51);
	TextDrawFont(Kraunasi2, 0);
	TextDrawSetProportional(Kraunasi2, 1);

	Kraunasi3 = TextDrawCreate(282.666656, 203.674026, "Lentele dings uz 5 ~r~sekundziu");
	TextDrawLetterSize(Kraunasi3, 0.124666, 1.653925);
	TextDrawAlignment(Kraunasi3, 1);
	TextDrawColor(Kraunasi3, -1);
	TextDrawSetShadow(Kraunasi3, 0);
	TextDrawSetOutline(Kraunasi3, 1);
	TextDrawBackgroundColor(Kraunasi3, 51);
	TextDrawFont(Kraunasi3, 2);
	TextDrawSetProportional(Kraunasi3, 1);

	Kraunasi4 = TextDrawCreate(275.000061, 137.718536, "Www.Survival-Island.LT");
	TextDrawLetterSize(Kraunasi4, 0.227333, 1.409185);
	TextDrawAlignment(Kraunasi4, 1);
	TextDrawColor(Kraunasi4, -1);
	TextDrawSetShadow(Kraunasi4, 0);
	TextDrawSetOutline(Kraunasi4, 1);
	TextDrawBackgroundColor(Kraunasi4, 51);
	TextDrawFont(Kraunasi4, 3);
	TextDrawSetProportional(Kraunasi4, 1);
Код:
public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid, Kraunasi0);
    TextDrawShowForPlayer(playerid, Kraunasi1);
    TextDrawShowForPlayer(playerid, Kraunasi2);
    TextDrawShowForPlayer(playerid, Kraunasi3);
    TextDrawShowForPlayer(playerid, Kraunasi4);
    SetTimerEx("TimeUp", 5000, false, "i", playerid);
    return 1;
}
Код:
forward TimeUp(playerid);
public TimeUp(playerid)
{

    TextDrawDestroy(Kraunasi0);
    TextDrawDestroy(Kraunasi1);
    TextDrawDestroy(Kraunasi2);
    TextDrawDestroy(Kraunasi3);
    TextDrawDestroy(Kraunasi4);
    return 1;
}
So it's basicly a textdraw that must appear while player spawns and it shows that objects are loading . So any help ?
Reply
#2

Rather than using TextDrawDestroy here, use TextDrawHideForPlayer...

Replace:
pawn Код:
forward TimeUp(playerid);
public TimeUp(playerid)
{

    TextDrawDestroy(Kraunasi0);
    TextDrawDestroy(Kraunasi1);
    TextDrawDestroy(Kraunasi2);
    TextDrawDestroy(Kraunasi3);
    TextDrawDestroy(Kraunasi4);
    return 1;
}
with:
pawn Код:
forward TimeUp(playerid);
public TimeUp(playerid)
{
    TextDrawHideForPlayer(playerid, Kraunasi0);
    TextDrawHideForPlayer(playerid, Kraunasi1);
    TextDrawHideForPlayer(playerid, Kraunasi2);
    TextDrawHideForPlayer(playerid, Kraunasi3);
    TextDrawHideForPlayer(playerid, Kraunasi4);
    return 1;
}
Reply
#3

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
Rather than using TextDrawDestroy here, use TextDrawHideForPlayer...

Replace:
pawn Код:
forward TimeUp(playerid);
public TimeUp(playerid)
{

    TextDrawDestroy(Kraunasi0);
    TextDrawDestroy(Kraunasi1);
    TextDrawDestroy(Kraunasi2);
    TextDrawDestroy(Kraunasi3);
    TextDrawDestroy(Kraunasi4);
    return 1;
}
with:
pawn Код:
forward TimeUp(playerid);
public TimeUp(playerid)
{
    TextDrawHideForPlayer(playerid, Kraunasi0);
    TextDrawHideForPlayer(playerid, Kraunasi1);
    TextDrawHideForPlayer(playerid, Kraunasi2);
    TextDrawHideForPlayer(playerid, Kraunasi3);
    TextDrawHideForPlayer(playerid, Kraunasi4);
    return 1;
}
Now it shows on spawn (works good) . But when i have done registration i have next the rp quiz which textdraw comes one so it shows until i spawn .
Reply
#4

Well just do:
pawn Код:
TimeUp(playerid);
when you open the 'rp quiz'.
Reply
#5

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
Well just do:
pawn Код:
TimeUp(playerid);
when you open the 'rp quiz'.
Well thank you ! Repped .
Reply
#6

-Add

Actually nope it didn't solve the problem

the script when rp quiz pops up

Код:
    switch( dialogid )
    {
         case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"{FFCC33}[Survival-Island.LT] Registracija",""COL_RED"Ivedete netinkama slaptazodi.\n"COL_WHITE"Prasome ivesti jusu sugalvota slaptazodi.","Registruotis","Atsaukti");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_Close(File);

                SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                TimeUp(playerid);
                ShowPlayerDialog(playerid,DIALOG_QUIZ,DIALOG_STYLE_LIST,"  {FFFFFF}Ka Reiskia {FFCC33}RP{FFFFFF}?"," {FFFFFF}{FFCC33}1.{FFFFFF}Real Play \n {FFCC33}2.{FFFFFF}Role Play \n {FFCC33}3.{FFFFFF}Real Pay","Pasirinkti","");
            }
        }
Reply
#7

UP !
Reply
#8

Problem:
SpawnPlayer(playerid);

Remove this, and put it into the dialog response for DIALOG_QUIZ. If you're not completely sure how to do this, please post or pm me your entire OnDialogResponse callback. (Sorry for the late reply as well)
Reply
#9

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
Problem:
SpawnPlayer(playerid);

Remove this, and put it into the dialog response for DIALOG_QUIZ. If you're not completely sure how to do this, please post or pm me your entire OnDialogResponse callback. (Sorry for the late reply as well)
I will send you the callback .
Reply
#10

Hmm okay... so yeah, looks like you pretty much just need to remove this: SpawnPlayer(playerid);
from your DIALOG_REGISTER response.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)