SA-MP Forums Archive
Get what a player types in a dialog? - 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: Get what a player types in a dialog? (/showthread.php?tid=134332)



Get what a player types in a dialog? - Fj0rtizFredde - 16.03.2010

Hello
Im making a new filterscript with dialogs and I want to know how to get what the player writes in the DIALOG_STYLE_INPUT :P Like if he writes Catfood then it will do something or if he types Dogfood then it will do something else :P I have done this with numbers before but not with text so I hope somebody knows how to do it

(I hope you understand what I mean and sorry for english and yes I have tried to search :P)


Re: Get what a player types in a dialog? - Martin_M - 16.03.2010

Quote:
Originally Posted by Fj0rtizFredde
Hello
Im making a new filterscript with dialogs and I want to know how to get what the player writes in the DIALOG_STYLE_INPUT :P Like if he writes Catfood then it will do something or if he types Dogfood then it will do something else :P I have done this with numbers before but not with text so I hope somebody knows how to do it

(I hope you understand what I mean and sorry for english and yes I have tried to search :P)
Code:
if(response)
{
new string[128];
format(string,128,"You typed: %s",strlen(inputtext));
}
I hope i'm understand You right.


Re: Get what a player types in a dialog? - Fj0rtizFredde - 16.03.2010

Well not really :P I mean like if a player types Catfood then it will do something or if the player types Dogfood it will do something else and it should only be those words


Re: Get what a player types in a dialog? - ¤Adas¤ - 16.03.2010

pawn Code:
if(!strcmp(inputtext, "PeopleFood", true))
{
// Do something...
}



Re: Get what a player types in a dialog? - Fj0rtizFredde - 16.03.2010

Quote:
Originally Posted by ¤Adas¤
pawn Code:
if(!strcmp(inputtext, "PeopleFood", true))
{
// Do something...
}
Thanks it works