[Request]Example :)
#4

What? Do you want when textdraw it's active, and if he write for example "1" withouth " " will show him help about that section?

If yes, you can do it.

First, to work more faster and don't type every time showin' / hidden them it's better to create a stock. So add in your script stocks for Hide/Show textdraws.

pawn Код:
stock Show(playerid)
{
    TextDrawShowForPlayer(playerid, Textdraw0);
    TextDrawShowForPlayer(playerid, Textdraw1);
    TextDrawShowForPlayer(playerid, Textdraw2);
    TextDrawShowForPlayer(playerid, Textdraw3);
    TextDrawShowForPlayer(playerid, Textdraw4);
    TextDrawShowForPlayer(playerid, Textdraw5);
    TextDrawShowForPlayer(playerid, Textdraw6);
    TextDrawShowForPlayer(playerid, Textdraw7);
    TextDrawShowForPlayer(playerid, Textdraw8);
    TextDrawShowForPlayer(playerid, Textdraw9);
    TextDrawShowForPlayer(playerid, Textdraw10);
    TextDrawShowForPlayer(playerid, Textdraw11);
    TextDrawShowForPlayer(playerid, Textdraw12);
}

stock Hide(playerid)
{
    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, Textdraw11);
    TextDrawHideForPlayer(playerid, Textdraw12);
}
... Good, now we need a commad to show that textdraws. I hope you use ZCMD. .
But first we make a variable, wich will check if textdraws are on his screen. Else when he write for example 1 in chat, then he will show that function you made.

pawn Код:
new ShowText[MAX_PLAYERS];
pawn Код:
CMD:show(playerid, params[])
{
    Show(playerid);
    ShowText[playerid] = 1;
    return 1;
}
- So now, Textdraw it's showin' when type command /Show, you can edit it, with your wish command.

Then we movin' under OnPlayerText and add:

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '1') // if he write 1 in chat
    {
        if(ShowText[playerid] == 1) // If Textdraws are open.
        {
            // Make your function right here
            // For Example
            SendClientMessage(playerid, -1, "{FF0000}INFO: {FFFFFF}You typed *1.");
        }
    }
    if(text[1] == '2') // if he write 2 in chat
    {
        if(ShowText[playerid] == 1)
        {
            // MAKE Another function here.
        }
    }
    return 1;
}
And you contiunue, like this, you get it.

! REMEMBER: - This it's Scripting Help, NOT request help / codes. I just helped you because I'm bored.

I hope this code will work for you.

UNTESTED CODE.

! NOTE:- Don't forget to add ShowText[playerid] = 0; under close textdraw code, else when you type " 1 ", " 2 ", etc, will show you functions you made under OnPlayerText(). Something like.

pawn Код:
CMD:close(playerid, params[])
{
    Hide(playerid);
    ShowText[playerid] = 0;
    return 1;
}
Reply


Messages In This Thread
[Request]Example :) - by astanalol - 23.12.2014, 13:37
Re: [Request]Example :) - by astanalol - 23.12.2014, 17:02
Re: [Request]Example :) - by Glossy42O - 23.12.2014, 17:08
Re: [Request]Example :) - by HY - 23.12.2014, 17:19
Re: [Request]Example :) - by astanalol - 23.12.2014, 17:52
Re: [Request]Example :) - by astanalol - 23.12.2014, 18:39
Re: [Request]Example :) - by HY - 23.12.2014, 19:07
Re: [Request]Example :) - by astanalol - 23.12.2014, 20:44
Re: [Request]Example :) - by astanalol - 23.12.2014, 23:10

Forum Jump:


Users browsing this thread: 1 Guest(s)