GUI Input
#1

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!
Reply
#2

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

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

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.
Reply
#5

Quote:

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

Something like that?
Reply
#6

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...
Reply
#7

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;
}

Reply
#8

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.
Reply
#9

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


Forum Jump:


Users browsing this thread: 1 Guest(s)