I need help DIALOG_INPUT
#1

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

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;

Reply
#3

@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")) 
Reply
#4

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

Thank All
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)