if ((id = House_Nearest(playerid)) != -1) { if (HouseData[id][houseLocked]) return SendErrorMessage(playerid, "You cannot enter a locked house."); SetPlayerPos(playerid, HouseData[id][houseInt][0], HouseData[id][houseInt][1], HouseData[id][houseInt][2]); SetPlayerFacingAngle(playerid, HouseData[id][houseInt][3]); SetPlayerInterior(playerid, HouseData[id][houseInterior]); SetPlayerVirtualWorld(playerid, HouseData[id][houseID] + 5000); SetCameraBehindPlayer(playerid); PlayerData[playerid][pHouse] = HouseData[id][houseID]; return 1; } if ((id = House_Inside(playerid)) != -1 && IsPlayerInRangeOfPoint(playerid, 2.5, HouseData[id][houseInt][0], HouseData[id][houseInt][1], HouseData[id][houseInt][2])) { SetPlayerPos(playerid, HouseData[id][housePos][0], HouseData[id][housePos][1], HouseData[id][housePos][2]); SetPlayerFacingAngle(playerid, HouseData[id][housePos][3] - 180.0); SetPlayerInterior(playerid, HouseData[id][houseExterior]); SetPlayerVirtualWorld(playerid, HouseData[id][houseExteriorVW]); SetCameraBehindPlayer(playerid); PlayerData[playerid][pHouse] = -1; return 1; }
[21:26:12] Number of vehicle models: 1 [21:26:12] New version of CrashDetect is available for download (4.13) [21:26:45] [connection] incoming connection: 127.0.0.1:63124 id: 0 [21:26:45] [debug] Run time error 20: "Invalid index parameter (bad entry point)" [21:26:45] [join] LctMF has joined the server (0:127.0.0.1) [21:27:07] [debug] Run time error 20: "Invalid index parameter (bad entry point)" [21:27:07] [debug] Run time error 20: "Invalid index parameter (bad entry point)" [21:27:10] [debug] Run time error 20: "Invalid index parameter (bad entry point)" [21:27:15] [debug] Run time error 20: "Invalid index parameter (bad entry point)" [21:27:16] [debug] Run time error 20: "Invalid index parameter (bad entry point)" [21:27:16] [debug] Run time error 20: "Invalid index parameter (bad entry point)" [21:27:16] [debug] Run time error 20: "Invalid index parameter (bad entry point)" [21:27:17] [debug] Run time error 20: "Invalid index parameter (bad entry point)" [21:27:18] [debug] Run time error 20: "Invalid index parameter (bad entry point)" [21:27:18] [debug] Run time error 20: "Invalid index parameter (bad entry point)" [21:27:18] [debug] Run time error 20: "Invalid index parameter (bad entry point)"
SetPlayerVirtualWorld(playerid, HouseData[id][houseExteriorVW]);
House_Create(playerid, address[], price) { static Float:x, Float:y, Float:z, Float:angle; if (GetPlayerPos(playerid, x, y, z) && GetPlayerFacingAngle(playerid, angle)) { for (new i = 0; i != MAX_HOUSES; i ++) { if (!HouseData[i][houseExists]) { HouseData[i][houseExists] = true; HouseData[i][houseOwner] = 0; HouseData[i][housePrice] = price; HouseData[i][houseMoney] = 0; format(HouseData[i][houseAddress], 32, address); HouseData[i][housePos][0] = x; HouseData[i][housePos][1] = y; HouseData[i][housePos][2] = z; HouseData[i][housePos][3] = angle; HouseData[i][houseInt][0] = 2269.8772; HouseData[i][houseInt][1] = -1210.3240; HouseData[i][houseInt][2] = 1047.5625; HouseData[i][houseInt][3] = 90.0000; HouseData[i][houseInterior] = 10; HouseData[i][houseExterior] = GetPlayerInterior(playerid); HouseData[i][houseExteriorVW] = GetPlayerVirtualWorld(playerid); HouseData[i][houseLights] = false; HouseData[i][houseLocked] = false; House_Refresh(i); mysql_tquery(g_iHandle, "INSERT INTO `houses` (`houseOwner`) VALUES(0)", "OnHouseCreated", "d", i); return i; } } } return -1; }
#define MAX_HOUSES 500
//Don't store information such as ID of entered house in player data enum, it has nothing to do with it. Instead, you can create a new variable:
// Top
new bool:IsInHouse[MAX_PLAYERS];
public OnPlayerDisconnect(playerid, reason)
{
bool:IsInHouse[playerid] = false;
return 1;
}
CMD:exit(playerid)
{
for(new i = 0; i < MAX_HOUSES; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.5, HouseData[i][houseInt][0], HouseData[i][houseInt][1], HouseData[i][houseInt][2])
{
SetPlayerPos(playerid, HouseData[i][housePos][0], HouseData[i][housePos][1], HouseData[i][housePos][2]);
SetPlayerFacingAngle(playerid, HouseData[i][housePos][3] - 180.0);
SetPlayerVirtualWorld(playerid, HouseData[i][houseExteriorVW]); // I don't know why you use this, you should have a default virtual world and reset it
SetCameraBehindPlayer(playerid);
IsInHouse[playerid] = false;
break;
}
}
return 1;
}
CMD:enter(playerid)
{
for(new i = 0; i < MAX_HOUSES; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.5, HouseData[i][houseInt][0], HouseData[i][houseInt][1], HouseData[i][houseInt][2])
{
if(HouseData[i][houseLocked]) return SendErrorMessage(playerid, "You cannot enter a locked house.");
SetPlayerPos(playerid, HouseData[i][houseInt][0], HouseData[i][houseInt][1], HouseData[i][houseInt][2]);
SetPlayerFacingAngle(playerid, HouseData[i][houseInt][3]);
SetPlayerInterior(playerid, HouseData[i][houseInterior]);
SetPlayerVirtualWorld(playerid, i); // You can just use house id as virtual world, it won't mix with others
SetCameraBehindPlayer(playerid);
IsInHouse[playerid] = true;
break;
}
}
return 1;
}
Try this m8
PHP код:
|
else if (newkeys & KEY_SECONDARY_ATTACK) { static id = -1;