SA-MP Forums Archive
I need help DIALOG_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: I need help DIALOG_INPUT (/showthread.php?tid=618854)



I need help DIALOG_INPUT - hoanduy - 10.10.2016

How to enter the correct word when the player then it will reward reward it. For example, when a player San Andreas enter into the input, it will award $ 5,000 was entered incorrectly will be charged $ 5,000. Because I do not know anything about Dialog_Input


Re: I need help DIALOG_INPUT - ChristolisTV - 10.10.2016

Hello. Try this!

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
     if(
dialogid == YOURDIALOGID//If our dialog id is YOURDIALOGID.
     
{
        if(
response//If player responded.
        
{
            if(
inputtext == "yourcorrectanswer"//If player answers 'yourcorrectanswer'.
            
{
               
SendClientMessage(playerid, -1"Genius answer pal!"); //Inform player that he entered correct message.
               
GivePlayerMoney(playerid5000); //Give him the money. (Change the value to everything you want)
            
}
            else 
//If he didn't reply well
            
{
               
SendClientMessage(playerid, -1"You answered wrong!"); //Inform player that he entered wrong answer.
            
}
        }
     }
     return 
0;




Re: I need help DIALOG_INPUT - Skimmer - 10.10.2016

@ChristolisTV

This way is not allowed in PAWN.
PHP код:
if(inputtext == "yourcorrectanswer"
use this instead
PHP код:
if(!strcmp(inputtext"yourcorrectanswer")) 
Don't forget to check the length of input.
PHP код:
if(strlen(inputtext) > && !strcmp(inputtext"yourcorrectanswer")) 



Re: I need help DIALOG_INPUT - ChristolisTV - 10.10.2016

Quote:
Originally Posted by Skimmer
Посмотреть сообщение
@ChristolisTV

This way is not allowed in PAWN.
PHP код:
if(inputtext == "yourcorrectanswer"
use this instead
PHP код:
if(!strcmp(inputtext"yourcorrectanswer")) 
Don't forget to check the length of input.
PHP код:
if(strlen(inputtext) > && !strcmp(inputtext"yourcorrectanswer")) 
Oh yeah you're right! I was sleepy when I typed that!


Re: I need help DIALOG_INPUT - hoanduy - 11.10.2016

Thank All