SA-MP Forums Archive
Enter Command problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Enter Command problem (/showthread.php?tid=500132)



Enter Command problem - ZBits - 11.03.2014

Fixed


Re: Enter Command problem - ZBits - 12.03.2014

Bump


Re: Enter Command problem - ZBits - 13.03.2014

Bump, still need help on this


Re: Enter Command problem - Threshold - 13.03.2014

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;
}