Need help with House Search in gps
#2

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=0i<sizeof(hausInfo); i++)
            {
                if(!
IsNumeric(inputtext))return SendClientMessage(playeridCOLOR_RED"Du kannst nur Zahlen eingeben.");
                if(
strval(inputtext) == hausInfo[i][hausnummer])
                {
                    
SetPlayerCheckpoint(playeridhausInfo[i][hx], hausInfo[i][hy], hausInfo[i][hz], 5);
                    
SendClientMessage(playeridCOLOR_WHITE"Das Haus wurde auf der Karte markiert.");    
                    return 
1;
                }
            }

            return 
SendClientMessage(playeridCOLOR_RED"Die Hausnummer gibt es nicht.");
        }
        else
        {
            return 
1;
        }
    } 
Reply


Messages In This Thread
Need help with House Search in gps - by ImTobi - 01.06.2018, 23:54
Re: Need help with House Search in gps - by DarkSkull - 02.06.2018, 00:27
Re: Need help with House Search in gps - by GTLS - 02.06.2018, 05:52
Re: Need help with House Search in gps - by ImTobi - 02.06.2018, 10:38
Re: Need help with House Search in gps - by ImTobi - 02.06.2018, 10:42
Re: Need help with House Search in gps - by ImTobi - 02.06.2018, 15:52
Re: Need help with House Search in gps - by GTLS - 03.06.2018, 06:26
Re: Need help with House Search in gps - by ImTobi - 03.06.2018, 10:18
Re: Need help with House Search in gps - by GTLS - 03.06.2018, 10:32
Re: Need help with House Search in gps - by ImTobi - 03.06.2018, 11:03
Re: Need help with House Search in gps - by GTLS - 03.06.2018, 11:14
Re: Need help with House Search in gps - by ImTobi - 03.06.2018, 11:22
Re: Need help with House Search in gps - by ImTobi - 03.06.2018, 20:02
Re: Need help with House Search in gps - by ImTobi - 05.06.2018, 23:38
Re: Need help with House Search in gps - by ImTobi - 07.06.2018, 14:57
Re: Need help with House Search in gps - by DaniceMcHarley - 07.06.2018, 15:43
Re: Need help with House Search in gps - by ImTobi - 08.06.2018, 12:28
Re: Need help with House Search in gps - by jasperschellekens - 08.06.2018, 13:33
Re: Need help with House Search in gps - by ImTobi - 08.06.2018, 19:37
Re: Need help with House Search in gps - by Logic_ - 09.06.2018, 03:17
Re: Need help with House Search in gps - by ImTobi - 09.06.2018, 10:26

Forum Jump:


Users browsing this thread: 1 Guest(s)