03.01.2014, 18:20
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?
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;
}