SA-MP Forums Archive
/enter not working propertly - 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 not working propertly (/showthread.php?tid=657693)



/enter not working propertly - DavidGravelli - 14.08.2018

The problem in the command is when i make a /bizexit for any businesses interior doesn't working fine.
- When i enter a biz i will falling.
What's the problem in this command?
Here is the /bizexit also.

pawn Код:
CMD:enter(playerid, params[])
{
        for(new i = 1; i < MAX_BIZ; i++)
        {
            if (IsPlayerInRangeOfPoint(playerid, 1.0, biz_info[i][biz_pos_entrance][0], biz_info[i][biz_pos_entrance][1], biz_info[i][biz_pos_entrance][2]) &&
                biz_info[i][biz_pos_exit][0] != -1)
            {
                if (biz_info[i][biz_lock])
                    return SCM(playerid, -1, "The business is closed.");

                if (GetPlayerMoney(playerid) < biz_info[i][biz_fee])
                    return SCM(playerid, -1, "You don't have enough money to enter this business.");

                GivePlayerMoney(playerid, -biz_info[i][biz_fee]);

                if(biz_info[i][biz_type] == BIZ_TYPE_247)
                {
                    playerInBiz[playerid] = biz_info[i][biz_type];
                }

                if(biz_info[i][biz_type] == BIZ_TYPE_CLOTHES)
                {
                    playerInBiz[playerid] = biz_info[i][biz_type];
                }  
                return SetPlayerPos(playerid, biz_info[i][biz_pos_exit][0], biz_info[i][biz_pos_exit][1], biz_info[i][biz_pos_exit][2]);
                }
               
    }
    return 1;
}

CMD:bizexit(playerid, params[])
{
    if (sscanf(params, "i", params[0]))
        return SCM(playerid,  -1, "/bizexit [business-id]");

    if (biz_info[params[0]][biz_id] != -1)
        return SCM(playerid, -1, "Invalid business id.");

    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);

    biz_info[params[0]][biz_pos_exit][0] = x;
    biz_info[params[0]][biz_pos_exit][1] = y;
    biz_info[params[0]][biz_pos_exit][2] = z;
    SaveBiz(biz_info[params[0]][biz_id]);

    SendInfo(playerid, "You have updated the business exit.");
    return 1;
}



Re: /enter not working propertly - Sew_Sumi - 14.08.2018

Is it a custom map interior?

Are you using the streamer for this mapped interior?


Re: /enter not working propertly - coool - 14.08.2018

Freeze the player for some time so the objects can load.


Re: /enter not working propertly - Sew_Sumi - 14.08.2018

Quote:
Originally Posted by coool
Посмотреть сообщение
Freeze the player for some time so the objects can load.
... if it's a streamer issue... But he hasn't come back about whether it is or not.


Also, if they're tping in to a native sa interior, it should just be there, as it's stock, so if that happens, it's something else.


Re: /enter not working propertly - DavidGravelli - 14.08.2018

Nah its not a custom interior
Let me check if that freeze thing will work.


Re: /enter not working propertly - Sew_Sumi - 14.08.2018

You're not saving or using the players interior ID then, as that'll make the various interiors invisible and non-clippable.

The freeze shouldn't do anything, as they simply threw it up trying to guess an answer.


Re: /enter not working propertly - brauf - 14.08.2018

Make sure the player is synced to the right virtual word, interior id and coordinate of the business.
If you have done all above, before entering the business, freeze the player for a few seconds so all objects can load, but usually in such a small interior (i'm assuming so) the objects should load seamlessly.

The objects you have created may be created at another virtual world. Try vw = -1 rather than 0 or 1.