Textdraws - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Textdraws (
/showthread.php?tid=91193)
Textdraws -
[TouchX]Ash - 13.08.2009
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.
Re: Textdraws -
ruarai - 13.08.2009
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(...)
}
}
Re: Textdraws -
[TouchX]Ash - 13.08.2009
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?