Dialog
#1

Код:
if(dialogid == DIALOOG_REG_KODAKONDSUS)
    {
		if(response)
		{
			new tmp[256];
			new idx;
	    	tmp = strtok(inputtext, idx);
		    if((strcmp("Los Santos", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("los santos")))
		    {
		        RegistreerimineEtapp[playerid] = 3;
		        PlayerInfo[playerid][pOrigin] = 1;
		        PlayerInfo[playerid][pReg] = 1;
		        ShowPlayerDialog(playerid, DIALOOG_REG_ALUSTAMINE, DIALOG_STYLE_MSGBOX, "Registreerimisesьsteem - (Alustamine)", " Tдnan registreerimast. \n Kas te soovite alustada lugemist хpetuse? Oleks parem, kui sa seda loeksid. (Siis kui oled algaja) \n", "Edasi", "Loobu");
			}
			else if((strcmp("San Fierro", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("san fierro")))
		    {
		        RegistreerimineEtapp[playerid] = 3;
		        PlayerInfo[playerid][pOrigin] = 2;
		        PlayerInfo[playerid][pReg] = 1;
		        ShowPlayerDialog(playerid, DIALOOG_REG_ALUSTAMINE, DIALOG_STYLE_MSGBOX, "Registreerimisesьsteem - (Alustamine)", " Tдnan registreerimast. \n Kas te soovite alustada lugemist хpetuse? Oleks parem, kui sa seda loeksid. (Siis kui oled algaja) \n", "Edasi", "Loobu");
			}
			else if((strcmp("Los Santos", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("los santos")))
		    {
		        RegistreerimineEtapp[playerid] = 3;
		        PlayerInfo[playerid][pOrigin] = 3;
		        PlayerInfo[playerid][pReg] = 1;
		        ShowPlayerDialog(playerid, DIALOOG_REG_ALUSTAMINE, DIALOG_STYLE_MSGBOX, "Registreerimisesьsteem - (Alustamine)", " Tдnan registreerimast. \n Kas te soovite alustada lugemist хpetuse? Oleks parem, kui sa seda loeksid. (Siis kui oled algaja) \n", "Edasi", "Loobu");
			}
			else
			{
			    ShowPlayerDialog(playerid, DIALOOG_REG_KODAKONDSUS, DIALOG_STYLE_INPUT, "Registreerimisesьsteem - (Kodakondsus)", "Milline kodakondsus on sinu karakter? (Los Santos / San Fierro / Las Venturas)", "Siseta", "");
   			}
		}
		else
		{
		    ShowPlayerDialog(playerid, DIALOOG_REG_KODAKONDSUS, DIALOG_STYLE_INPUT, "Registreerimisesьsteem - (Kodakondsus)", "Milline kodakondsus on sinu karakter? (Los Santos / San Fierro / Las Venturas)", "Siseta", "");
		}
    }
Код:
new tmp[256];
			new idx;
	    	tmp = strtok(inputtext, idx);
		    if((strcmp("Los Santos", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("los santos")))
		    {
I type input: Los Santos, and it shows again that same dialog. I tryed too: San Fierro, Las Venturas, still same problem.

What problem? :S
Reply
#2

help
Reply
#3

strtok puts everything in the 'tmp' between a space and another, so the value in 'tmp' is just 'Los', not "Los Santos"
Reply
#4

How i do then it? Los Santos, San Fierro, Las Venturas and los santos, san fierro, las venturas... etc
Reply
#5

Could try:

pawn Код:
format(tmp, sizeof tmp, "%s %s", strtok(inputtext, idx), strtok(inputtext, idx));
Might work, I'm unsure.
Reply
#6

How system will read, is she/he did typed los santos, san fierro or las venturas?
Reply
#7

pawn Код:
if(!strcmp(tmp, "Los Santos"))
{
  //Do shit
}
else if(!strcmp(tmp, "San Fierro"))
{
  //Do shit
}
else if(!strcmp(tmp, "Las Venturas"))
{
  //Do shit
}
Reply
#8

Код:
if(dialogid == DIALOOG_REG_KODAKONDSUS)
    {
		if(response)
		{
			new tmp[256];
			new idx;
	    	tmp = strtok(inputtext, idx);
if(!strcmp(tmp, "Los Santos"))
{
  //Do shit
}
else if(!strcmp(tmp, "San Fierro"))
{
  //Do shit
}
else if(!strcmp(tmp, "Las Venturas"))
{
  //Do shit
}
}
else
{
// exit
}
}
or wat?
Reply
#9

Just the code you have now,

but instead of

'tmp = strtok(cmdtext, idx);'

you do

'format(tmp, sizeof tmp, "%s %s", strtok(inputtext, idx), strtok(inputtext, idx));'
Reply
#10

Tested, it doens't work. Shows again dialog, when i type "Los Santos"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)