Textdraws
#1

Hai,

How would I make it so, when a textdraw is showing, if they type a certain thing without a "/" it shows something else.

Example:

"/help" shows a textdraw named "Textdrawhelp"
When that textdraw is showing it brings up a list of categories with a number for each one.
When they type that number it shows the next Textdraw... Which could be called Textdraw2.

(Don't worry, I've already made the textdraws)

Thanks.
Reply
#2

First, create a variable that shows that the player is in the help textdraw, for now use something like this "new inhelp[MAX_PLAYERS];.
Then after that add something like this:
pawn Code:
public OnPlayerText(playerid, text[])
{
   if(text[0] == "1" && inhelp[playerid] == 1)
   {
      ShowTextDrawForPlayer(...)
   }
   if(text[0] == "2" && inhelp[playerid] == 1)
   {
      ShowTextDrawForPlayer(...)
   }
}
Reply
#3

Thanks, I'll give that a go soon.


After a lot of tinkering I can't get it to work still.

Yours as it is gives 2 errors:
Code:
error 001: expected token: "-string end-", but found "-identifier-"
On these lines:
Code:
if(text[0] == "1" && inhelp[playerid] == 1)
if(text[0] == "2" && inhelp[playerid] == 1)
It's probably something obvious but I'm not sure what. Also if this code works, will it show the person typing "1 (or 2)" in the chat?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)