[HELP] Textdraws wont show up
#1

So when I made these textdraws, They wont show up correctly. I have tried everything. It seems like they are calling on the wrong ones when it tries to show up. For example this is what it looks like
http://imageshack.us/a/img705/9295/samp061ro.png

Here is the code for the textdraws.

This is for the left chat
pawn Код:
stock SendGlobalMsg(color, string[])
{
    if(CurrentGlobalMsg == 0)
    {
        foreach(Player, i)
        {
            if(IsInChatMenu[i])
            {
                TextDrawShowForPlayer(i,GlobalTextdraw0);
                TextDrawSetString(GlobalTextdraw0,string);
                CurrentGlobalMsg++;
            }
        }
    }
    else if(CurrentGlobalMsg == 1)
    {
        foreach(Player, i)
        {
            if(IsInChatMenu[i])
            {
                TextDrawShowForPlayer(i,GlobalTextdraw1);
                TextDrawSetString(GlobalTextdraw1,string);
                CurrentGlobalMsg++;
            }
        }
    }
    else if(CurrentGlobalMsg == 2)
    {
        foreach(Player, i)
        {
            if(IsInChatMenu[i])
            {
                TextDrawShowForPlayer(i,GlobalTextdraw2);
                TextDrawSetString(GlobalTextdraw2,string);
                CurrentGlobalMsg++;
            }
        }
    }
    else if(CurrentGlobalMsg == 3)
    {
        foreach(Player, i)
        {
            if(IsInChatMenu[i])
            {
                TextDrawShowForPlayer(i,GlobalTextdraw3);
                TextDrawSetString(GlobalTextdraw3,string);
                CurrentGlobalMsg++;
            }
        }
    }
    else if(CurrentGlobalMsg == 4)
    {
        foreach(Player, i)
        {
            if(IsInChatMenu[i])
            {
                TextDrawShowForPlayer(i,GlobalTextdraw4);
                TextDrawSetString(GlobalTextdraw4,string);
                CurrentGlobalMsg++;
            }
        }
    }
    else if(CurrentGlobalMsg == 5)
    {
        foreach(Player, i)
        {
            if(IsInChatMenu[i])
            {
                TextDrawShowForPlayer(i,GlobalTextdraw5);
                TextDrawSetString(GlobalTextdraw5,string);
                CurrentGlobalMsg++;
            }
        }
    }
    else if(CurrentGlobalMsg == 6)
    {
        foreach(Player, i)
        {
            if(IsInChatMenu[i])
            {
                TextDrawShowForPlayer(i,GlobalTextdraw6);
                TextDrawSetString(GlobalTextdraw6,string);
                CurrentGlobalMsg++;
            }
        }
    }
    else if(CurrentGlobalMsg == 7)
    {
        foreach(Player, i)
        {
            if(IsInChatMenu[i])
            {
                TextDrawShowForPlayer(i,GlobalTextdraw7);
                TextDrawSetString(GlobalTextdraw7,string);
                CurrentGlobalMsg++;
            }
        }
    }
    else if(CurrentGlobalMsg == 8)
    {
        foreach(Player, i)
        {
            if(IsInChatMenu[i])
            {
                TextDrawShowForPlayer(i,GlobalTextdraw8);
                TextDrawSetString(GlobalTextdraw8,string);
                CurrentGlobalMsg++;
            }
        }
    }
    else if(CurrentGlobalMsg == 9)
    {
        foreach(Player, i)
        {
            if(IsInChatMenu[i])
            {
                TextDrawShowForPlayer(i,GlobalTextdraw9);
                TextDrawSetString(GlobalTextdraw9,string);
                CurrentGlobalMsg++;
            }
        }
    }
    else if(CurrentGlobalMsg == 10)
    {
        foreach(Player, i)
        {
            if(IsInChatMenu[i])
            {
                TextDrawShowForPlayer(i,GlobalTextdraw10);
                TextDrawSetString(GlobalTextdraw10,string);
                CurrentGlobalMsg++;
            }
        }
    }
    else if(CurrentGlobalMsg == 11)
    {
        foreach(Player, i)
        {
            if(IsInChatMenu[i])
            {
                TextDrawShowForPlayer(i,GlobalTextdraw0);
                TextDrawShowForPlayer(i,GlobalTextdraw1);
                TextDrawShowForPlayer(i,GlobalTextdraw2);
                TextDrawShowForPlayer(i,GlobalTextdraw3);
                TextDrawShowForPlayer(i,GlobalTextdraw4);
                TextDrawShowForPlayer(i,GlobalTextdraw5);
                TextDrawShowForPlayer(i,GlobalTextdraw6);
                TextDrawShowForPlayer(i,GlobalTextdraw7);
                TextDrawShowForPlayer(i,GlobalTextdraw8);
                TextDrawShowForPlayer(i,GlobalTextdraw9);
                TextDrawShowForPlayer(i,GlobalTextdraw10);
                TextDrawSetString(GlobalTextdraw0,"");
                TextDrawSetString(GlobalTextdraw1,"");
                TextDrawSetString(GlobalTextdraw2,"");
                TextDrawSetString(GlobalTextdraw3,"");
                TextDrawSetString(GlobalTextdraw4,"");
                TextDrawSetString(GlobalTextdraw5,"");
                TextDrawSetString(GlobalTextdraw6,"");
                TextDrawSetString(GlobalTextdraw7,"");
                TextDrawSetString(GlobalTextdraw8,"");
                TextDrawSetString(GlobalTextdraw9,"");
                TextDrawSetString(GlobalTextdraw10,"");
                CurrentGlobalMsg = 0;
                TextDrawShowForPlayer(i,GlobalTextdraw0);
                TextDrawSetString(GlobalTextdraw0,string);
                CurrentGlobalMsg++;
            }
        }
    }
}
This is the one for the right chat

pawn Код:
stock SendPlatoonMsg(groupid, color, string[])
{
    if(CurrentMsg == 0)
    {
        if(groupid > 0)
        {
            foreach(Player, i)
            {
                if(playerVariables[i][pGroup] == groupid)
                {
                    if(IsInChatMenu[i])
                    {
                        TextDrawShowForPlayer(i,Textdraw0);
                        TextDrawSetString(Textdraw0,string);
                        CurrentMsg++;
                    }
                }
            }
        }
    }
    else if(CurrentMsg == 1)
    {
        if(groupid > 0)
        {
            foreach(Player, i)
            {
                if(playerVariables[i][pGroup] == groupid)
                {
                    if(IsInChatMenu[i])
                    {
                        TextDrawShowForPlayer(i,Textdraw1);
                        TextDrawSetString(Textdraw1,string);
                        CurrentMsg++;
                    }
                }
            }
        }
    }
    else if(CurrentMsg == 2)
    {
        if(groupid > 0)
        {
            foreach(Player, i)
            {
                if(playerVariables[i][pGroup] == groupid)
                {
                    if(IsInChatMenu[i])
                    {
                        TextDrawShowForPlayer(i,Textdraw2);
                        TextDrawSetString(Textdraw2,string);
                        CurrentMsg++;
                    }
                }
            }
        }
    }
    else if(CurrentMsg == 3)
    {
        if(groupid > 0)
        {
            foreach(Player, i)
            {
                if(playerVariables[i][pGroup] == groupid)
                {
                    if(IsInChatMenu[i])
                    {
                        TextDrawShowForPlayer(i,Textdraw3);
                        TextDrawSetString(Textdraw3,string);
                        CurrentMsg++;
                    }
                }
            }
        }
    }
    else if(CurrentMsg == 4)
    {
        if(groupid > 0)
        {
            foreach(Player, i)
            {
                if(playerVariables[i][pGroup] == groupid)
                {
                    if(IsInChatMenu[i])
                    {
                        TextDrawShowForPlayer(i,Textdraw4);
                        TextDrawSetString(Textdraw4,string);
                        CurrentMsg++;
                    }
                }
            }
        }
    }
    else if(CurrentMsg == 5)
    {
        if(groupid > 0)
        {
            foreach(Player, i)
            {
                if(playerVariables[i][pGroup] == groupid)
                {
                    if(IsInChatMenu[i])
                    {
                        TextDrawShowForPlayer(i,Textdraw5);
                        TextDrawSetString(Textdraw5,string);
                        CurrentMsg++;
                    }
                }
            }
        }
    }
    else if(CurrentMsg == 6)
    {
        if(groupid > 0)
        {
            foreach(Player, i)
            {
                if(playerVariables[i][pGroup] == groupid)
                {
                    if(IsInChatMenu[i])
                    {
                        TextDrawShowForPlayer(i,Textdraw6);
                        TextDrawSetString(Textdraw6,string);
                        CurrentMsg++;
                    }
                }
            }
        }
    }
    else if(CurrentMsg == 7)
    {
        if(groupid > 0)
        {
            foreach(Player, i)
            {
                if(playerVariables[i][pGroup] == groupid)
                {
                    if(IsInChatMenu[i])
                    {
                        TextDrawShowForPlayer(i,Textdraw7);
                        TextDrawSetString(Textdraw7,string);
                        CurrentMsg++;
                    }
                }
            }
        }
    }
    else if(CurrentMsg == 8)
    {
        if(groupid > 0)
        {
            foreach(Player, i)
            {
                if(playerVariables[i][pGroup] == groupid)
                {
                    if(IsInChatMenu[i])
                    {
                        TextDrawShowForPlayer(i,Textdraw8);
                        TextDrawSetString(Textdraw8,string);
                        CurrentMsg++;
                    }
                }
            }
        }
    }
    else if(CurrentMsg == 9)
    {
        if(groupid > 0)
        {
            foreach(Player, i)
            {
                if(playerVariables[i][pGroup] == groupid)
                {
                    if(IsInChatMenu[i])
                    {
                        TextDrawShowForPlayer(i,Textdraw9);
                        TextDrawSetString(Textdraw9,string);
                        CurrentMsg++;
                    }
                }
            }
        }
    }
    else if(CurrentMsg == 10)
    {
        if(groupid > 0)
        {
            foreach(Player, i)
            {
                if(playerVariables[i][pGroup] == groupid)
                {
                    if(IsInChatMenu[i])
                    {
                        TextDrawShowForPlayer(i,Textdraw10);
                        TextDrawSetString(Textdraw10,string);
                        CurrentMsg++;
                    }
                }
            }
        }
    }
    else if(CurrentMsg == 11)
    {
        if(groupid > 0)
        {
            foreach(Player, i)
            {
                if(playerVariables[i][pGroup] == groupid)
                {
                    if(IsInChatMenu[i])
                    {
                        TextDrawShowForPlayer(i,Textdraw0);
                        TextDrawShowForPlayer(i,Textdraw1);
                        TextDrawShowForPlayer(i,Textdraw2);
                        TextDrawShowForPlayer(i,Textdraw3);
                        TextDrawShowForPlayer(i,Textdraw4);
                        TextDrawShowForPlayer(i,Textdraw5);
                        TextDrawShowForPlayer(i,Textdraw6);
                        TextDrawShowForPlayer(i,Textdraw7);
                        TextDrawShowForPlayer(i,Textdraw8);
                        TextDrawShowForPlayer(i,Textdraw9);
                        TextDrawShowForPlayer(i,Textdraw10);
                        TextDrawSetString(Textdraw0,"-");
                        TextDrawSetString(Textdraw1,"-");
                        TextDrawSetString(Textdraw2,"-");
                        TextDrawSetString(Textdraw3,"-");
                        TextDrawSetString(Textdraw4,"-");
                        TextDrawSetString(Textdraw5,"-");
                        TextDrawSetString(Textdraw6,"-");
                        TextDrawSetString(Textdraw7,"-");
                        TextDrawSetString(Textdraw8,"-");
                        TextDrawSetString(Textdraw9,"-");
                        TextDrawSetString(Textdraw10,"-");
                        CurrentMsg = 0;
                        TextDrawShowForPlayer(i,Textdraw0);
                        TextDrawSetString(Textdraw0,string);
                        CurrentMsg++;
                    }
                }
            }
        }
    }
}
Help?
PS. I will show more code if needed
Reply
#2

Try this:

pawn Код:
stock SendGlobalMsg(color, string[])
{
    foreach(Player, i)
    {
        if(IsInChatMenu[i])
        {
            switch(CurrentGlobalMsg)
            {
                case 0:
                {
                    TextDrawShowForPlayer(i,GlobalTextdraw0);
                    TextDrawSetString(GlobalTextdraw0,string);
                }
                case 1:
                {
                    TextDrawShowForPlayer(i,GlobalTextdraw1);
                    TextDrawSetString(GlobalTextdraw1,string);
                }
                case 2:
                {
                    TextDrawShowForPlayer(i,GlobalTextdraw2);
                    TextDrawSetString(GlobalTextdraw2,string);
                }
                case 3:
                {
                    TextDrawShowForPlayer(i,GlobalTextdraw3);
                    TextDrawSetString(GlobalTextdraw3,string);
                }
                case 4:
                {
                    TextDrawShowForPlayer(i,GlobalTextdraw4);
                    TextDrawSetString(GlobalTextdraw4,string);
                }
                case 5:
                {
                    TextDrawShowForPlayer(i,GlobalTextdraw5);
                    TextDrawSetString(GlobalTextdraw5,string);
                }
                case 6:
                {
                    TextDrawShowForPlayer(i,GlobalTextdraw6);
                    TextDrawSetString(GlobalTextdraw6,string);
                }
                case 7:
                {
                    TextDrawShowForPlayer(i,GlobalTextdraw7);
                    TextDrawSetString(GlobalTextdraw7,string);
                }
                case 8:
                {
                    TextDrawShowForPlayer(i,GlobalTextdraw8);
                    TextDrawSetString(GlobalTextdraw8,string);
                }
                case 9:
                {
                    TextDrawShowForPlayer(i,GlobalTextdraw9);
                    TextDrawSetString(GlobalTextdraw9,string);
                }
                case 10:
                {
                    TextDrawShowForPlayer(i,GlobalTextdraw10);
                    TextDrawSetString(GlobalTextdraw10,string);
                }
                case 11:
                {
                    TextDrawShowForPlayer(i,GlobalTextdraw0);
                    TextDrawShowForPlayer(i,GlobalTextdraw1);
                    TextDrawShowForPlayer(i,GlobalTextdraw2);
                    TextDrawShowForPlayer(i,GlobalTextdraw3);
                    TextDrawShowForPlayer(i,GlobalTextdraw4);
                    TextDrawShowForPlayer(i,GlobalTextdraw5);
                    TextDrawShowForPlayer(i,GlobalTextdraw6);
                    TextDrawShowForPlayer(i,GlobalTextdraw7);
                    TextDrawShowForPlayer(i,GlobalTextdraw8);
                    TextDrawShowForPlayer(i,GlobalTextdraw9);
                    TextDrawShowForPlayer(i,GlobalTextdraw10);
                    TextDrawSetString(GlobalTextdraw0,"");
                    TextDrawSetString(GlobalTextdraw1,"");
                    TextDrawSetString(GlobalTextdraw2,"");
                    TextDrawSetString(GlobalTextdraw3,"");
                    TextDrawSetString(GlobalTextdraw4,"");
                    TextDrawSetString(GlobalTextdraw5,"");
                    TextDrawSetString(GlobalTextdraw6,"");
                    TextDrawSetString(GlobalTextdraw7,"");
                    TextDrawSetString(GlobalTextdraw8,"");
                    TextDrawSetString(GlobalTextdraw9,"");
                    TextDrawSetString(GlobalTextdraw10,"");
                    CurrentGlobalMsg = 0;
                    TextDrawShowForPlayer(i,GlobalTextdraw0);
                    TextDrawSetString(GlobalTextdraw0,string);
                }
            }
        }
    }
    CurrentGlobalMsg++;
    return 1;
}
Reply
#3

That Fixed it! Thank you! <33333333333

REP+ for you

**EDIT**

Can that kind of a switch also be used for the Platoon chat?
Reply
#4

Yes, you should be able to use it in the Platoon chat. I'm guessing you can deconstruct the code and understand it by yourself.

EDIT: I don't mind doing that code for you either if you want me to.
Reply
#5

I can do it, I understand it, But if you want to do it I am not going to say no hahaha.

Also, When someone isnt in the chat menu it still shows up with the chat, Why is this?

**EDIT**

The Global Chat is showing up, Not the Platoon chat, that works just fine.
Reply
#6

Show me where you set IsInChatMenu. Example: IsInChatMenu[playerid] = 1;
Reply
#7

new IsInChatMenu[MAX_PLAYERS];
That is up where all the defines and what not is.

IsInChatMenu[playerid] = 0;
This is placed in OnPlayerConnect

**EDIT**

Also in OnPlayerClickTextdraw

pawn Код:
if(clickedid == chat)
    {
         SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on Chat.");
         TextDrawHideForPlayer(playerid, multiplayer);
         TextDrawHideForPlayer(playerid, coop);
         TextDrawHideForPlayer(playerid, premium);
         TextDrawHideForPlayer(playerid, soldier);
         TextDrawHideForPlayer(playerid, options);
         TextDrawHideForPlayer(playerid, store);
         TextDrawHideForPlayer(playerid, extras);
         TextDrawHideForPlayer(playerid, chat);
         TextDrawHideForPlayer(playerid, logo);
         TextDrawHideForPlayer(playerid, killbox[0]);
         TextDrawHideForPlayer(playerid, killbox[1]);
         TextDrawHideForPlayer(playerid, killbox[2]);
         TextDrawShowForPlayer(playerid, globalchatbox[0]);
         TextDrawShowForPlayer(playerid, globalchatbox[1]);
         TextDrawShowForPlayer(playerid, globalchatbox[2]);
         TextDrawShowForPlayer(playerid, globalchatbox[3]);
         TextDrawShowForPlayer(playerid, globalchatbox[4]);
         TextDrawShowForPlayer(playerid, serverchatbox[0]);
         TextDrawShowForPlayer(playerid, serverchatbox[1]);
         TextDrawShowForPlayer(playerid, serverchatbox[2]);
         IsInChatMenu[playerid] = 1;
    }
Reply
#8

Change it to:
pawn Код:
new bool:IsInChatMenu[MAX_PLAYERS];
I'm assuming there is a command to open the chat menu?
pawn Код:
//Open Chat menu Command Here
IsInChatMenu[playerid] = true; //If they open the chat menu (This line is INSIDE the command)
//code continues...
pawn Код:
//Close Chat Menu Command Here
IsInChatMenu[playerid] = false; //If they close the chat menu (This line is INSIDE the command)
//code continues...
If you need further assistance, add me on Skype. I won't give it out publicly, but just PM me your skype name if you have one, and I won't refrain from helping as much as I can.
Reply
#9

This opens up the main menu which has the Chat Textdraw of which you can open the chat menu with
pawn Код:
CMD:menu(playerid, params[])
{
    TextDrawShowForPlayer(playerid, background);
    TextDrawShowForPlayer(playerid, newsbox);
    TextDrawShowForPlayer(playerid, multiplayer);
    TextDrawShowForPlayer(playerid, coop);
    TextDrawShowForPlayer(playerid, premium);
    TextDrawShowForPlayer(playerid, soldier);
    TextDrawShowForPlayer(playerid, options);
    TextDrawShowForPlayer(playerid, store);
    TextDrawShowForPlayer(playerid, extras);
    TextDrawShowForPlayer(playerid, chat);
    TextDrawShowForPlayer(playerid, killbox[0]);
    TextDrawShowForPlayer(playerid, killbox[1]);
    TextDrawShowForPlayer(playerid, killbox[2]);
    TextDrawShowForPlayer(playerid, logo);
    SelectTextDraw(playerid, 0x00FF00FF);
    IsInMenu[playerid] = 1;
    newsmessage();
    return 1;
}

CMD:closemenu(playerid, params[])
{
    TextDrawHideForPlayer(playerid, background);
    TextDrawHideForPlayer(playerid, newsbox);
    TextDrawHideForPlayer(playerid, multiplayer);
    TextDrawHideForPlayer(playerid, coop);
    TextDrawHideForPlayer(playerid, premium);
    TextDrawHideForPlayer(playerid, soldier);
    TextDrawHideForPlayer(playerid, options);
    TextDrawHideForPlayer(playerid, store);
    TextDrawHideForPlayer(playerid, extras);
    TextDrawHideForPlayer(playerid, chat);
    TextDrawHideForPlayer(playerid, killbox[0]);
    TextDrawHideForPlayer(playerid, killbox[1]);
    TextDrawHideForPlayer(playerid, killbox[2]);
    TextDrawHideForPlayer(playerid, newsmessagetext);
    TextDrawHideForPlayer(playerid, newsmessagetext2);
    TextDrawHideForPlayer(playerid, newsmessagetext3);
    TextDrawHideForPlayer(playerid, logo);
    CancelSelectTextDraw(playerid);
    IsInMenu[playerid] = 0;
    IsInChatMenu[playerid] = 0;
    return 1;
}
This opens the chat menu itself.
pawn Код:
CMD:chat(playerid, params[])
{
    TextDrawShowForPlayer(playerid, background);
    TextDrawShowForPlayer(playerid, background2);
    TextDrawShowForPlayer(playerid, newsbox);
    TextDrawShowForPlayer(playerid, globalchatbox[0]);
    TextDrawShowForPlayer(playerid, globalchatbox[1]);
    TextDrawShowForPlayer(playerid, globalchatbox[2]);
    TextDrawShowForPlayer(playerid, globalchatbox[3]);
    TextDrawShowForPlayer(playerid, globalchatbox[4]);
    TextDrawShowForPlayer(playerid, serverchatbox[0]);
    TextDrawShowForPlayer(playerid, serverchatbox[1]);
    TextDrawShowForPlayer(playerid, serverchatbox[2]);
    SelectTextDraw(playerid, 0x00FF00FF);
    IsInChatMenu[playerid] = 1;
    newsmessage();
    return 1;
}

CMD:closechat(playerid, params[])
{
    TextDrawHideForPlayer(playerid, Textdraw0);
    TextDrawHideForPlayer(playerid, Textdraw1);
    TextDrawHideForPlayer(playerid, Textdraw2);
    TextDrawHideForPlayer(playerid, Textdraw3);
    TextDrawHideForPlayer(playerid, Textdraw4);
    TextDrawHideForPlayer(playerid, Textdraw5);
    TextDrawHideForPlayer(playerid, Textdraw6);
    TextDrawHideForPlayer(playerid, Textdraw7);
    TextDrawHideForPlayer(playerid, Textdraw8);
    TextDrawHideForPlayer(playerid, Textdraw9);
    TextDrawHideForPlayer(playerid, Textdraw10);
    TextDrawHideForPlayer(playerid, background);
    TextDrawHideForPlayer(playerid, background2);
    TextDrawHideForPlayer(playerid, newsbox);
    TextDrawHideForPlayer(playerid, globalchatbox[0]);
    TextDrawHideForPlayer(playerid, globalchatbox[1]);
    TextDrawHideForPlayer(playerid, globalchatbox[2]);
    TextDrawHideForPlayer(playerid, globalchatbox[3]);
    TextDrawHideForPlayer(playerid, globalchatbox[4]);
    TextDrawHideForPlayer(playerid, serverchatbox[0]);
    TextDrawHideForPlayer(playerid, serverchatbox[1]);
    TextDrawHideForPlayer(playerid, serverchatbox[2]);
    TextDrawHideForPlayer(playerid, newsmessagetext);
    TextDrawHideForPlayer(playerid, newsmessagetext2);
    TextDrawHideForPlayer(playerid, newsmessagetext3);
    CancelSelectTextDraw(playerid);
    IsInChatMenu[playerid] = 0;
    IsInMenu[playerid] = 0;
    return 1;
}
Please also keep in mind these commands are not not saying permanently, There are only for my use as testing purposes.

I do not have a Skype, However, I have a Teamspeak server as well as a GTalk.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)