SA-MP Forums Archive
How to do this - 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: How to do this (/showthread.php?tid=615293)



How to do this - ThatFag - 20.08.2016

currently im making a system which gives player permission to rob a bank or something
the problem is when players fails 1 time his dialog dissapears but i want the same dialog to come up with different numbers but the dialog wont show up

Код:
if(strcmp(inputtext, randomzznr, true) == 1)return ShowPlayerDialog(playerid,1002,DIALOG_STYLE_INPUT,"Business rob",strings,"Continue","");// Checks if the inputtext returns the word; hi
    {
 randomstr(randomzznr);

 format(strings,sizeof(strings),"---Step 3---\nWrite The following in order to continue\n\n%s",randomzznr);
    ShowPlayerDialog(playerid,1003,DIALOG_STYLE_INPUT,"Drug Production",strings,"Continue","");
    return 1;
    }
 }



Re: How to do this - SyS - 20.08.2016

do the same above ondialogresponse of this dialog but remember that to declare a var to check how many times he can do it and each time increment it.


Re: How to do this - ThatFag - 20.08.2016

i did at all 3 of them but still now even if a player presses anything like just 1 letter it passes


Re: How to do this - Shinja - 20.08.2016

Quote:
Originally Posted by ThatFag
Посмотреть сообщение
Код:
if(strcmp(inputtext, randomzznr, true) == 1)return ShowPlayerDialog(playerid,1002,DIALOG_STYLE_INPUT,"Business rob",strings,"Continue","");// Checks if the inputtext returns the word; hi
    {
 randomstr(randomzznr);

 format(strings,sizeof(strings),"---Step 3---\nWrite The following in order to continue\n\n%s",randomzznr);
    ShowPlayerDialog(playerid,1003,DIALOG_STYLE_INPUT,"Drug Production",strings,"Continue","");
    return 1;
    }
 }
This code seems wrong, you made an if statement (if() return action) and you open brackets again, it makes no sense at all, show full code please


Re: How to do this - SyS - 20.08.2016

Your code has some logical mistakes you are opening the if statement that has single statement (return one) on top so your if statement wont work as you expect to.


Re: How to do this - ThatFag - 20.08.2016

here it is
Код:
if(dialogid == 1003)
{
new strings[300];
if(strcmp(inputtext, randomzznr, true) == 0)//; hi
    {
    SendClientMessage(playerid, -1,"You've broken  into the biz");

    return 1;
    }
}
if(dialogid == 1002)
{
new strings[300];
if(strcmp(inputtext, randomzznr, true) == 0)//s if the inputtext returns the word; hi
    {
 randomstr(randomzznr);

 format(strings,sizeof(strings),"---Step 3---\nWrite The following in order to continue\n\n%s",randomzznr);
    ShowPlayerDialog(playerid,1003,DIALOG_STYLE_INPUT,"testing",strings,"Continue","");
    return 1;
    }
 }
if(dialogid == 1001)
 {
  new strings[300];
if(strcmp(inputtext, randomzznr, true) == 0)// Checks if the inputtext returns the word; hi
    {
    randomstr(randomzznr);
    format(strings,sizeof(strings),"---Step 2---\nWrite The following in order to continue\n\n%s",randomzznr);
    ShowPlayerDialog(playerid,1002,DIALOG_STYLE_INPUT,"testing",strings,"Continue","");
	return 1;
  }
 }



Re: How to do this - Shinja - 20.08.2016

Quote:
Originally Posted by ThatFag
Посмотреть сообщение
Код:
if(strcmp(inputtext, randomzznr, true) == 1)return ShowPlayerDialog(playerid,1002,DIALOG_STYLE_INPUT,"Business rob",strings,"Continue","");// Checks if the inputtext returns the word; hi
    {
 randomstr(randomzznr);

 format(strings,sizeof(strings),"---Step 3---\nWrite The following in order to continue\n\n%s",randomzznr);
    ShowPlayerDialog(playerid,1003,DIALOG_STYLE_INPUT,"Drug Production",strings,"Continue","");
    return 1;
    }
 }
But where is this part? and explain more what you want to do


Re: How to do this - ThatFag - 20.08.2016

now when player is on a robbery this dialog shows up -- step 2--
what i want is for exxample
player has to say"Hello" and when dialog shows up he presses "hell" or any other things that is not "hello" will reshow the dialog cuz with this code i have it just got gonne


Re: How to do this - ThatFag - 20.08.2016

Please help me i really need this