29.12.2014, 17:52
Still not working however, i have did this and i still not see the checkpoint when near the house exterior. and interior
+REP to whoever fixes me this issue as i have no clue on what i am doing not scripted in a long time.
Код:
House_Nearest(playerid) { for (new i = 0; i != MAX_HOUSES; i ++) if (HouseData[i][houseExists] && IsPlayerInRangeOfPoint(playerid, 2.5, HouseData[i][housePos][0], HouseData[i][housePos][1], HouseData[i][housePos][2])) { if (GetPlayerInterior(playerid) == HouseData[i][houseExterior] && GetPlayerVirtualWorld(playerid) == HouseData[i][houseExteriorVW]) return i; } // Checkpoint if(IsPlayerInRangeOfPoint(playerid, HouseData[houseid][housePos][0], HouseData[houseid][housePos][1], HouseData[houseid][housePos][2])) { SetPlayerCheckpoint(playerid, HouseData[houseid][housePos][0], HouseData[houseid][housePos][1], HouseData[houseid][housePos][2]); return 1; } return -1; }
Код:
House_Refresh(houseid, playerid) { if (houseid != -1 && HouseData[houseid][houseExists]) { if (IsValidDynamic3DTextLabel(HouseData[houseid][houseText3D])) DestroyDynamic3DTextLabel(HouseData[houseid][houseText3D]); // Destroying the checkpoint if player leaves or house gets destroyed DisablePlayerCheckpoint(HouseData[houseid][houseCheckpoint]); if (IsValidDynamicMapIcon(HouseData[houseid][houseMapIcon])) DestroyDynamicMapIcon(HouseData[houseid][houseMapIcon]); static string[128]; if (!HouseData[houseid][houseOwner]) { format(string, sizeof(string), "[%s]\n%s", FormatNumber(HouseData[houseid][housePrice]), HouseData[houseid][houseAddress]); HouseData[houseid][houseText3D] = CreateDynamic3DTextLabel(string, 0x33AA33FF, HouseData[houseid][housePos][0], HouseData[houseid][housePos][1], HouseData[houseid][housePos][2], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, HouseData[houseid][houseExteriorVW], HouseData[houseid][houseExterior]); } else { format(string, sizeof(string), "%s", HouseData[houseid][houseAddress]); HouseData[houseid][houseText3D] = CreateDynamic3DTextLabel(string, COLOR_WHITE, HouseData[houseid][housePos][0], HouseData[houseid][housePos][1], HouseData[houseid][housePos][2], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, HouseData[houseid][houseExteriorVW], HouseData[houseid][houseExterior]); } // Checkpoint if(IsPlayerInRangeOfPoint(playerid, HouseData[houseid][housePos][0], HouseData[houseid][housePos][1], HouseData[houseid][housePos][2])) { SetPlayerCheckpoint(playerid, HouseData[houseid][housePos][0], HouseData[houseid][housePos][1], HouseData[houseid][housePos][2]); return 1; } //HouseData[houseid][houseCheckpoint] = CreateDynamicPickup(1273, 23, HouseData[houseid][housePos][0], HouseData[houseid][housePos][1], HouseData[houseid][housePos][2], HouseData[houseid][houseExteriorVW], HouseData[houseid][houseExterior]); HouseData[houseid][houseMapIcon] = CreateDynamicMapIcon(HouseData[houseid][housePos][0], HouseData[houseid][housePos][1], HouseData[houseid][housePos][2], (HouseData[houseid][houseOwner] != 0) ? (32) : (31), 0, HouseData[houseid][houseExteriorVW], HouseData[houseid][houseExterior]); } return 1; }
Код:
CMD:createhouse(playerid, params[]) { static price, id, address[32]; if (PlayerData[playerid][pAdmin] < 5) return SendErrorMessage(playerid, "You don't have permission to use this command."); if (sscanf(params, "ds[32]", price, address)) return SendSyntaxMessage(playerid, "/createhouse [price] [address]"); for (new i = 0; i != MAX_HOUSES; i ++) if (HouseData[i][houseExists] && !strcmp(HouseData[i][houseAddress], address, true)) { return SendErrorMessage(playerid, "The address \"%s\" is already in use (ID: %d).", address, i); } id = House_Create(playerid, address, price); if (id == -1) return SendErrorMessage(playerid, "The server has reached the limit for houses."); SendServerMessage(playerid, "You have successfully created house ID: %d.", id); return 1; } CMD:destroyhouse(playerid, params[]) { static id = 0; if (PlayerData[playerid][pAdmin] < 5) return SendErrorMessage(playerid, "You don't have permission to use this command."); if (sscanf(params, "d", id)) return SendSyntaxMessage(playerid, "/destroyhouse [house id]"); if ((id < 0 || id >= MAX_HOUSES) || !HouseData[id][houseExists]) return SendErrorMessage(playerid, "You have specified an invalid house ID."); House_Delete(id); SendServerMessage(playerid, "You have successfully destroyed house ID: %d.", id); return 1; }