03.01.2014, 19:22
Quote:
It does not work, it always takes a few seconds before entering the house...
|
pawn Код:
public OnPlayerPickUpDynamicPickup(playerid,pickupid)
{
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
for(new i = 0; i < totalhouses; i++)
{
if( pickupid == HousePickup[ i ] )
{
if( PlayerToPointStripped( 1, playerid, HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez], cx, cy, cz ) )
{
if( house_isProprio( playerid, i ) || house_isLocataire( playerid, i ) )
{
SetInterior( playerid, HouseInfo[i][hInt] );
SetPlayerPos( playerid, HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz] );
PlayerInfo[playerid][pInHouse] = i;
switch( HouseInfo[ i ][ hEdited ] )
{
case 1: SetVirtualWorld(playerid, 0);
default: SetVirtualWorld(playerid, i); //Suspicious code that might be the problem.
}
if( house_isProprio( playerid, i ) || house_isLocataire( playerid, i ) ) {
HouseInfo[ i ][ hFrigo ] += biz_recupration[playerid], biz_recupration[playerid] = 0;
}
if(HouseInfo[ i ][ hLock ] == 1) {
GameTextForPlayer(playerid, "~r~Door closed..", 5000, 1);
}
if(HouseInfo[ i ][ hOwned ] == 0) {
SendClientMessage(playerid, COLOR_MAISON, "You see a house. You can buy.");
}
}
}
break;
}
}
return 1;
}