05.07.2012, 17:02
(
Последний раз редактировалось jeffery30162; 06.07.2012 в 19:17.
)
EDIT:
I found out how to make the icon on the map now but sometimes it doesn't show and sometimes its not at the right coordinates. please help.
well Im using PPC_Housing
And for the icon will only show up for that players house.
Heres some stuff that i tried to put it in:
Does put the house icon at the right location
I found out how to make the icon on the map now but sometimes it doesn't show and sometimes its not at the right coordinates. please help.
well Im using PPC_Housing
And for the icon will only show up for that players house.
Heres some stuff that i tried to put it in:
Does put the house icon at the right location
Код:
public OnPlayerSpawn(playerid) { // Setup local variables new HouseID; // Reset the HouseID where the player is located APlayerData[playerid][CurrentHouse] = 0; for (HouseID = 1; HouseID < MAX_HOUSES; HouseID++) { SetPlayerMapIcon(playerid, 1, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ], 35, 0, MAPICON_GLOBAL); } // If SpawnAtHouse is set to "true", re-position the player at the first house in his list of owned houses if (SpawnAtHouse == true) { // Get the first HouseID in your list of owned houses HouseID = APlayerData[playerid][Houses][0]; // Check if the player has a house in this first slot if (HouseID != 0) { // Re-position the player at the house's coordinates SetPlayerPos(playerid, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]); } } return 1; }
Код:
Dialog_GoHome(playerid, response, listitem) { // Just close the dialog if the player clicked "Cancel" if(!response) return 1; // Setup local variables new HouseIndex, HouseID; // The listitem directly indicates the house-index HouseIndex = listitem; // Get the HouseID HouseID = APlayerData[playerid][Houses][HouseIndex]; // Check if this is a valid house (HouseID != 0) if (HouseID != 0) { // Get the coordinates of the house's entrance SetPlayerPos(playerid, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]); for (HouseID = 1; HouseID < MAX_HOUSES; HouseID++) { SetPlayerMapIcon(playerid, 1, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ], 35, 0, MAPICON_GLOBAL); } } else SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}You don't have a house in this house-slot"); return 1; }
Код:
public House_ExitTimer(playerid, HouseID) { // Allow the player to move again (environment should have been loaded now) TogglePlayerControllable(playerid, 1); // Respawn the player's vehicles near the house (only the vehicles that belong to this house) for (new CarSlot; CarSlot < AHouseData[HouseID][CarSlots]; CarSlot++) if (AHouseData[HouseID][VehicleIDs][CarSlot] != 0) SetVehicleToRespawn(AHouseData[HouseID][VehicleIDs][CarSlot]); SetPlayerMapIcon( playerid, 1, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ], 35, 0, MAPICON_GLOBAL); return 1; }