Lots of Errors
#3

Quote:
Originally Posted by Misiur
Посмотреть сообщение
1. You don't have to rewrite the variables
2. This is 2d array, not single dimensional, so you need to specify which element you are using:

pawn Код:
CMD:enter(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 2.0, EnterAndExit[0][EnterPointX], EnterAndExit[0][EnterPointY], EnterAndExit[0][EnterPointZ]))
    {
        SetPlayerPos(playerid, 246.8042, 63.3659, 1003.6406);
        SetPlayerInterior(playerid, 6);
    }
    return 1;
}
It worked, but now it will only check the first line of the enum right? I want to prevent doing this:
pawn Код:
CMD:enter(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 2.0, EnterAndExit[0][EnterPointX], EnterAndExit[0][EnterPointY], EnterAndExit[0][EnterPointZ]))
    {
        SetPlayerPos(playerid, 246.8042, 63.3659, 1003.6406);
        SetPlayerInterior(playerid, 6);
    }
    else if(IsPlayerInRangeOfPoint(playerid, 2.0, EnterAndExit[1][EnterPointX], EnterAndExit[1][EnterPointY], EnterAndExit[1][EnterPointZ]))
    {
        SetPlayerPos(playerid, 246.8042, 63.3659, 1003.6406);
        SetPlayerInterior(playerid, 6);
    }
    else if(IsPlayerInRangeOfPoint(playerid, 2.0, EnterAndExit[2][EnterPointX], EnterAndExit[2][EnterPointY], EnterAndExit[2][EnterPointZ]))
    {
        SetPlayerPos(playerid, 246.8042, 63.3659, 1003.6406);
        SetPlayerInterior(playerid, 6);
    }
    return 1;
}
So actually what I want is that I only need to do IsPlayerInRangeOfPoint once and it will check all the coordinates in the enum and then choose the coordinates where he is at.
Reply


Messages In This Thread
Lots of Errors - by MechaTech - 12.09.2013, 06:36
Re: Lots of Errors - by Misiur - 12.09.2013, 07:35
Respuesta: Re: Lots of Errors - by MechaTech - 12.09.2013, 07:38
Re: Lots of Errors - by Misiur - 12.09.2013, 07:43
Respuesta: Re: Lots of Errors - by MechaTech - 12.09.2013, 07:46

Forum Jump:


Users browsing this thread: 1 Guest(s)