PDA

View Full Version : Textdraw doesn't show on spawn sometimes it even doesn't show


Immortal_LTU
22/10/2013, 03:25 PM
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 ?

Threshold
22/10/2013, 03:29 PM
Rather than using TextDrawDestroy here, use TextDrawHideForPlayer...

Replace:
forward TimeUp(playerid);
public TimeUp(playerid)
{

TextDrawDestroy(Kraunasi0);
TextDrawDestroy(Kraunasi1);
TextDrawDestroy(Kraunasi2);
TextDrawDestroy(Kraunasi3);
TextDrawDestroy(Kraunasi4);
return 1;
}

with:
forward TimeUp(playerid);
public TimeUp(playerid)
{
TextDrawHideForPlayer(playerid, Kraunasi0);
TextDrawHideForPlayer(playerid, Kraunasi1);
TextDrawHideForPlayer(playerid, Kraunasi2);
TextDrawHideForPlayer(playerid, Kraunasi3);
TextDrawHideForPlayer(playerid, Kraunasi4);
return 1;
}

Immortal_LTU
22/10/2013, 03:44 PM
Rather than using TextDrawDestroy here, use TextDrawHideForPlayer...

Replace:
forward TimeUp(playerid);
public TimeUp(playerid)
{

TextDrawDestroy(Kraunasi0);
TextDrawDestroy(Kraunasi1);
TextDrawDestroy(Kraunasi2);
TextDrawDestroy(Kraunasi3);
TextDrawDestroy(Kraunasi4);
return 1;
}

with:
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 .

Threshold
22/10/2013, 03:46 PM
Well just do:
TimeUp(playerid);
when you open the 'rp quiz'.

Immortal_LTU
22/10/2013, 04:09 PM
Well just do:
TimeUp(playerid);
when you open the 'rp quiz'.

Well thank you ! Repped .:p

Immortal_LTU
22/10/2013, 06:10 PM
-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","");
}
}

Immortal_LTU
23/10/2013, 06:47 AM
UP !

Threshold
24/10/2013, 06:46 AM
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)

Immortal_LTU
24/10/2013, 07:04 AM
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 .

Threshold
24/10/2013, 07:22 AM
Hmm okay... so yeah, looks like you pretty much just need to remove this: SpawnPlayer(playerid);
from your DIALOG_REGISTER response.

Immortal_LTU
24/10/2013, 07:52 AM
Hmm okay... so yeah, looks like you pretty much just need to remove this: SpawnPlayer(playerid);
from your DIALOG_REGISTER response.

Thanks it worked ! .