TextDraw Won't Close - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: TextDraw Won't Close (
/showthread.php?tid=455371)
TextDraw Won't Close -
RandomDude - 01.08.2013
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == CommandHelp[3]) // If the player clicked on the teleportLS textdraw, teleport him there!
{
for(new i = 0; i < sizeof(TextDraw); i++)
{
TextDrawShowForPlayer(playerid, Generalcmds[i]);
}
/*for(new i = 0; i < sizeof(TextDraw); i++)
{
TextDrawHideForPlayer(playerid, CommandHelp[i]);
}*/
}
else if(clickedid == CommandHelp[4]) // Same as above, but for SF
{
SetPlayerPos(playerid, -1424.6083, -290.9622, 14.1484);
SetPlayerFacingAngle(playerid, 134.9570);
}
else if(clickedid == CommandHelp[5]) // Same, but for LV
{
SetPlayerPos(playerid, 1688.7990, 1447.7753, 10.7675);
SetPlayerFacingAngle(playerid, 267.3902);
}
// Hide the textdraws after the player has seen textdraw himself.
for(new i = 0; i < sizeof(TextDraw); i++)
{
TextDrawHideForPlayer(playerid, CommandHelp[i]);
}
CancelSelectTextDraw(playerid); // Everything worked out perfectly, now stop the player to be able to select shizzle.
return 1;
}
In game the textdraw don't close
I have to click esc to close the other textdraw
because then there are 2 textdraws -_-
Re: TextDraw Won't Close -
RandomDude - 06.08.2013
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnn
Re: TextDraw Won't Close -
RandomDude - 06.08.2013
\\\\\\\\\\\\\\\\\\\\
Re: TextDraw Won't Close -
RandomDude - 12.08.2013
zzzzzzzzzzzzzzzzzzz
Re: TextDraw Won't Close -
Basssiiie - 12.08.2013
Maybe because you try to show the textdraws in the GeneralCmds array:
Код:
for(new i = 0; i < sizeof(TextDraw); i++)
{
TextDrawShowForPlayer(playerid, Generalcmds[i]);
}
But hide all the textdraws which are in the CommandHelp array:
Код:
for(new i = 0; i < sizeof(TextDraw); i++)
{
TextDrawHideForPlayer(playerid, CommandHelp[i]);
}
If that isn't the problem, then the problem isn't in this part of the script. It might be possible that you are overwriting the array slots, while the old textdraws still exist. (So they can't be accessed anymore, because their ID has been overwritten by a newer textdraw.)