Worries optimision...
#1

Hello to you.

So I have an input into a house pickup system.
When the player moves the pickup that teleports in the house.
The trouble, instead it is instantaneous, it takes a few seconds (3-4) before the teleport and I do not understand why.

Could you help me?

pawn Код:
public OnPlayerPickUpDynamicPickup(playerid,pickupid)
{
    new Float:cx, Float:cy, Float:cz;
    GetPlayerPos(playerid, cx, cy, cz);
    for(new houseid = 0; houseid < totalhouses; houseid++)
    {
        if(pickupid == HousePickup[houseid])
        {
            if(PlayerToPointStripped(1, playerid,HouseInfo[houseid][hEntrancex], HouseInfo[houseid][hEntrancey], HouseInfo[houseid][hEntrancez], cx, cy, cz))
            {
                if(house_isProprio(playerid, houseid) || house_isLocataire(playerid, houseid) || HouseInfo[houseid][hLock] == 0 || HouseInfo[houseid][hOwned] == 0 || (HouseInfo[houseid][hLock] == 1 && HouseInfo[houseid][hOwned] == 0))
                {
                    if(HouseInfo[houseid][hOwned] == 0) // No buy
                    {
                   
                    }
                    if(HouseInfo[houseid][hEdited] == 0)
                    {
                        SetVirtualWorld(playerid, houseid);
                    }
                    else if(HouseInfo[houseid][hEdited] == 1)
                    {
                        SetVirtualWorld(playerid, 0);
                    }
                    if(house_isProprio(playerid, houseid) || house_isLocataire(playerid, houseid))
                    {
                        HouseInfo[houseid][hFrigo] += biz_recupration[playerid];
                        biz_recupration[playerid] = 0;
                    }
                    SetInterior(playerid,HouseInfo[houseid][hInt]);
                    SetPlayerPos(playerid, HouseInfo[houseid][hExitx], HouseInfo[houseid][hExity], HouseInfo[houseid][hExitz]);
                    PlayerInfo[playerid][pInHouse] = houseid;
                    if(HouseInfo[houseid][hOwned] == 0)
                    SendClientMessage(playerid, COLOR_MAISON, "You see a house. You can buy.");
                }
                else
                {
                    GameTextForPlayer(playerid, "~r~Door closed..", 5000, 1);
                }
                return 1;
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Worries optimision... - by JacobWilkerson - 03.01.2014, 18:20
Re: Worries optimision... - by Patrick - 03.01.2014, 18:27
Re: Worries optimision... - by JacobWilkerson - 03.01.2014, 18:41
Re: Worries optimision... - by Patrick - 03.01.2014, 19:22
Re: Worries optimision... - by JacobWilkerson - 03.01.2014, 19:50
Re: Worries optimision... - by JacobWilkerson - 04.01.2014, 09:33
Re: Worries optimision... - by JacobWilkerson - 05.01.2014, 13:42

Forum Jump:


Users browsing this thread: 1 Guest(s)