02.06.2018, 00:27
Yes. That will happen as what your code does is that if the houseid is not found, It will break the loop. For example, if houseid 0 doesn't exists and 1 exists, It will stop the loop at 0. Try this
PHP код:
if(dialogid == NAVIDIALOGHAUS)
{
if(response)
{
for(new i=0; i<sizeof(hausInfo); i++)
{
if(!IsNumeric(inputtext))return SendClientMessage(playerid, COLOR_RED, "Du kannst nur Zahlen eingeben.");
if(strval(inputtext) == hausInfo[i][hausnummer])
{
SetPlayerCheckpoint(playerid, hausInfo[i][hx], hausInfo[i][hy], hausInfo[i][hz], 5);
SendClientMessage(playerid, COLOR_WHITE, "Das Haus wurde auf der Karte markiert.");
return 1;
}
}
return SendClientMessage(playerid, COLOR_RED, "Die Hausnummer gibt es nicht.");
}
else
{
return 1;
}
}