Help with OnPlayerKeyStateChange
#14

Not working ... The problem is that, after the first loop, if I'm not in the range of any point, there's nothing to 'continue' with ... I was thinking about a loop in a loop? Something like:
pawn Код:
for(new b = 1; b<=MAX_BUYABLE_BUS; b++)
        {
            printf("Business looped: %i", b);
            new pxVW = GetPlayerVirtualWorld(playerid);
            if(IsPlayerInRangeOfPoint(playerid, 1, B_DATA[b][bEnterX], B_DATA[b][bEnterY], B_DATA[b][bEnterZ]))
            {
                SetPlayerPos(playerid, B_DATA[b][bExitX], B_DATA[b][bExitY], B_DATA[b][bExitZ]);
                SetPlayerInterior(playerid, B_DATA[b][bExitInt]);
                SetPlayerVirtualWorld(playerid, B_DATA[b][bExitVW]);
                break;
            }
            else if(IsPlayerInRangeOfPoint(playerid, 1, B_DATA[b][bExitX], B_DATA[b][bExitY], B_DATA[b][bExitZ]) && pxVW == B_DATA[b][bExitVW])
            {
                SetPlayerPos(playerid, B_DATA[b][bEnterX], B_DATA[b][bEnterY], B_DATA[b][bEnterZ]);
                SetPlayerInterior(playerid, B_DATA[b][bEnterInt]);
                SetPlayerVirtualWorld(playerid, B_DATA[b][bEnterVW]);
                break;
            }
            else for(new c = 1; c<=MAX_FACTIONS; c++)
            {
            printf("Factions looped: %i", c);
            new pxVW = GetPlayerVirtualWorld(playerid);
                   if(IsPlayerInRangeOfPoint(playerid, 1, F_DATA[c][fEnterX], F_DATA[c][fEnterY], F_DATA[c][fEnterZ]))
                   {
                   SetPlayerPos(playerid, F_DATA[c][fExitX], F_DATA[c][fExitY], F_DATA[c][fExitZ]);
                   SetPlayerInterior(playerid, F_DATA[c][fInt]);
                   SetPlayerVirtualWorld(playerid, F_DATA[c][fVW]);
                   break;
               }
                       else if(IsPlayerInRangeOfPoint(playerid, 1, F_DATA[c][fExitX], F_DATA[c][fExitY], F_DATA[c][fExitZ]) && pxVW == F_DATA[c][fVW])
                      {
                   SetPlayerPos(playerid, F_DATA[c][fEnterX], F_DATA[c][fEnterY], F_DATA[c][fEnterZ]);
                   SetPlayerInterior(playerid, 0);
                   SetPlayerVirtualWorld(playerid, 0);
                   break;
               }
        }
        }
Would something like this work? A loop in a loop?

Meh ... If I think better, no, it's not good, because the other if statements from the callback wouldn't work ...
Reply


Messages In This Thread
Help with OnPlayerKeyStateChange - by antonio112 - 12.11.2011, 23:51
Re: Help with OnPlayerKeyStateChange - by Calgon - 13.11.2011, 00:22
Re: Help with OnPlayerKeyStateChange - by antonio112 - 13.11.2011, 00:24
Re: Help with OnPlayerKeyStateChange - by Calgon - 13.11.2011, 00:29
Re: Help with OnPlayerKeyStateChange - by antonio112 - 13.11.2011, 00:41
Re: Help with OnPlayerKeyStateChange - by Calgon - 13.11.2011, 00:42
Re: Help with OnPlayerKeyStateChange - by antonio112 - 13.11.2011, 00:46
Re: Help with OnPlayerKeyStateChange - by Calgon - 13.11.2011, 00:52
Re: Help with OnPlayerKeyStateChange - by antonio112 - 13.11.2011, 01:09
Re: Help with OnPlayerKeyStateChange - by antonio112 - 13.11.2011, 13:05
Re: Help with OnPlayerKeyStateChange - by xxmitsu - 13.11.2011, 13:49
Re: Help with OnPlayerKeyStateChange - by antonio112 - 13.11.2011, 14:16
Re: Help with OnPlayerKeyStateChange - by xxmitsu - 13.11.2011, 14:42
Re: Help with OnPlayerKeyStateChange - by antonio112 - 13.11.2011, 14:58
Re: Help with OnPlayerKeyStateChange - by xxmitsu - 13.11.2011, 15:01
Re: Help with OnPlayerKeyStateChange - by antonio112 - 13.11.2011, 16:00
Re: Help with OnPlayerKeyStateChange - by xxmitsu - 13.11.2011, 18:15
Re: Help with OnPlayerKeyStateChange - by MadeMan - 13.11.2011, 18:42
Re: Help with OnPlayerKeyStateChange - by xxmitsu - 13.11.2011, 18:53
Re: Help with OnPlayerKeyStateChange - by MadeMan - 13.11.2011, 19:03
Re: Help with OnPlayerKeyStateChange - by antonio112 - 14.11.2011, 21:30
Re: Help with OnPlayerKeyStateChange - by antonio112 - 16.11.2011, 13:04

Forum Jump:


Users browsing this thread: 8 Guest(s)