Enter Command problem
#1

Fixed
Reply
#2

Bump
Reply
#3

Bump, still need help on this
Reply
#4

Watch your loops and 'if' statements.

pawn Код:
CMD:enter(playerid, params[])
{
    for(new a; a < MAX_BUSINESSES; a++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 4.0, bInfo[a][Interior][0], bInfo[a][Interior][1], bInfo[a][Interior][2]))
        {
            SetPlayerPos(playerid, bInfo[a][Position][0], bInfo[a][Position][1], bInfo[a][Position][2]);
            SetPlayerVirtualWorld(playerid, bInfo[a][bVW]);
            SetPlayerInterior(playerid,bInfo[a][bINT]);
            pInfo[playerid][IsInsideBizz] = a;
            return 1;
        }
    }
    for(new k; k < MAX_HOUSES; k++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 4.0, hInfo[k][Interior][0], hInfo[k][Interior][1], hInfo[k][Interior][2]))
        {
            SetPlayerPos(playerid, hInfo[k][Position][0], hInfo[k][Position][1], hInfo[k][Position][2]);
            SetPlayerVirtualWorld(playerid, hInfo[k][hVW]);
            SetPlayerInterior(playerid, hInfo[k][hINT]);
            pInfo[playerid][IsInsideHouse] = k;
            return 1;
        }
    }
    if(IsPlayerInRangeOfPoint(playerid, 4.0, 1654.1300, -1658.2354, 22.5156))
        SetPlayerPos(playerid, 2935.2739, -1804.0499, 1191.0657);
    else if(IsPlayerInRangeOfPoint(playerid, 4.0, 1366.2668, -1279.8425, 13.5469))
    {
        SetPlayerPos(playerid, 286.148986, -40.644397, 1001.515625);
        SetPlayerInterior(playerid, 1);
    }
    else SendClientMessage(playerid, COLOR_PINK2, "Error: Not near entry point");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)