[help] How to get PPC_Housing to show the House icon for player
#1

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
Код:
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;
}
Reply
#2

Don't mean to bump, but i really need this. please help me
Reply
#3

Are you talking about the map icon? If so, you can find those on the wiki
Reply
#4

yes i am can u show me the code i have to add to these scriptlets above
Reply
#5

Everything you need is here


https://sampwiki.blast.hk/wiki/SetPlayerMapIcon
Reply
#6

helped alittle. but can you help me with the coordinates. are the in game and mini map coordinates alike?

please help me with this.
Reply
#7

Quote:
Originally Posted by jeffery30162
Посмотреть сообщение
helped alittle. but can you help me with the coordinates. are the in game and mini map coordinates alike?

please help me with this.
Exactly the same coordinates. The position you are ingame, that is where the map icon will appear on the map.
Reply
#8

well i found out how to make the icon but sometimes the icon doesn't show up or its across map
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)