Dual Loop
#1

Hello!

So for some reason the code i made is not working...
So the code is to check if is player in range of a object... Every player can have 200 objects... And the coordinates are saved as
posX[playerid][object-number], posY...
So now if i want to check all the object positions i need a dual loop(one loop for all the players, other for all the objects)
Код:
    
        for(new pid = 0; pid < MAX_PLAYERS; pid++)
	{
		for(new id=0; id<201; id++)
		{
			if(IsPlayerInRangeOfPoint(playerid,3.0,posX[pid][id],posY[pid][id],posZ[pid][id]))
			{
                              return SendClientMessage(playerid,COLOR_RED,"You are too close.");
			}
                        //something here...
		}
	}
Hope someone understands me

EDIT: This script is for a command so a player can create a object - and he mustn't be close to other objects of other players (and of course his objects)...
Reply


Messages In This Thread
Dual Loop - by Fjclip99 - 15.07.2015, 22:01
Re: Dual Loop - by Azula - 15.07.2015, 22:08
Re: Dual Loop - by Fjclip99 - 15.07.2015, 22:15
Re: Dual Loop - by Stanford - 15.07.2015, 22:50
Re: Dual Loop - by Fjclip99 - 16.07.2015, 09:14
Re: Dual Loop - by mamorunl - 16.07.2015, 09:43
Re: Dual Loop - by Fjclip99 - 16.07.2015, 12:15

Forum Jump:


Users browsing this thread: 2 Guest(s)