I want to make something like a securtiycode, where the must have at least 2 right numbers.
Tried this but got an error "type missmatch".
Could sb. tell me, how it is right?
Код:
if(dialogid == d_BANK+1)
{
if(response == 1)
{
new
string[128],
code = strval(inputtext),
rand1 = random(9),
rand2 = random(9),
rand3 = random(9),
rand4 = random(9),
rand5 = random(9),
rand6 = random(9),
richtige = 0;
new
code1 = strfind(inputtext, rand1, true),
code2 = strfind(inputtext, rand2, true),
code3 = strfind(inputtext, rand3, true),
code4 = strfind(inputtext, rand4, true),
code5 = strfind(inputtext, rand5, true),
code6 = strfind(inputtext, rand6, true);
if(code1 > -1) richtige +=1;
if(code2 > -1) richtige +=1;
if(code3 > -1) richtige +=1;
if(code4 > -1) richtige +=1;
if(code5 > -1) richtige +=1;
if(code6 > -1) richtige +=1;
if(richtige > 2) Bank_2(playerid);
else Bank_3(playerid);
}
else
{
BankStep[playerid] = 0;
// ...
}
}