TextDraw Won't Close
#1

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 -_-
Reply
#2

nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnn
Reply
#3

\\\\\\\\\\\\\\\\\\\\
Reply
#4

zzzzzzzzzzzzzzzzzzz
Reply
#5

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.)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)