SA-MP Forums Archive
GUI Input - 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)
+--- Thread: GUI Input (/showthread.php?tid=284746)



GUI Input - lukas567 - 20.09.2011

Hey!
What script checks if player typed in Input style GUI some text like GUI?
Well I want to make Scripting Test for everybody so one question is What is the type of this Box? So they have to type GUI if they want correct answer.
Thanks!


Re: GUI Input - |_ⒾⓇⓄN_ⒹⓄG_| - 20.09.2011

https://sampwiki.blast.hk/wiki/OnDialogResponse
you can detect if the player wrote something or not


Re: GUI Input - lukas567 - 20.09.2011

So whats the script that detects and checks what player wrote?


Re: GUI Input - Ash. - 20.09.2011

Quote:
Originally Posted by lukas567
Посмотреть сообщение
So whats the script that detects and checks what player wrote?
You'd need to use an if statement and the "strcmp" function in OnDialogResponse.


Re: GUI Input - lukas567 - 20.09.2011

Quote:

if(!strcmp(inputtext,"gui",true))

Something like that?


Re: GUI Input - Ash. - 20.09.2011

Quote:
Originally Posted by lukas567
Посмотреть сообщение
Something like that?
Yes! Exactly like that!

This forum requires that you wait 120 seconds between posts. Please try again in 97 seconds.
Guess I type to quickly.. Sorry Mr. Forum...


Re: GUI Input - lukas567 - 20.09.2011

Quote:

D:\Siuntiniai\PAWNO Testas\gamemodes\PTest.pwn(272) : error 029: invalid expression, assumed zero
D:\Siuntiniai\PAWNO Testas\gamemodes\PTest.pwn(272) : error 004: function "OnPlayerClickPlayer" is not implemented
D:\Siuntiniai\PAWNO Testas\gamemodes\PTest.pwn(276) : error 030: compound statement not closed at the end of file (started at line 227)

Errors

Code:
Quote:

if(dialogid == 3)
{
if(!response)
{
SendClientMessage(playerid,Red,"Wrong...");
ShowPlayerDialog(playerid,4,DIALOG_STYLE_LIST,"Que stion?","answers","Answer","IDK");
}
if(response)
{
if(!strcmp(inputtext,"gui",true))
{
SendClientMessage(playerid,Green,"Right!");
ShowPlayerDialog(playerid,4,DIALOG_STYLE_LIST,"Que stion?","Answers","Answer","IDK");
}
return 1;
}




Re: GUI Input - Ash. - 20.09.2011

pawn Код:
if(dialogid == 3)
{
    if(!response)
    {
        SendClientMessage(playerid,Red,"Wrong...");
        ShowPlayerDialog(playerid,4,DIALOG_STYLE_LIST,"Que stion?","answers","Answer","IDK");
    }

    if(response)
    {
        if(!strcmp(inputtext,"gui",true))
        {
            SendClientMessage(playerid,Green,"Right!");
            ShowPlayerDialog(playerid,4,DIALOG_STYLE_LIST,"Que stion?","Answers","Answer","IDK");  
        }//You forgot this!
    }
    return 1;
}
You forgot a closing bracket. Indent your code correctly, and you'll see problems like that instantly! Also, you could just use "else" rather than checking if response is true AFTER you checked if it was false.


Re: GUI Input - lukas567 - 20.09.2011

LOL
I forgot
Thanks! Wait for my Pawno Test Release!(Coming soon)