Dialog Spam
#1

Hi,

I was wondering if someone could shed some light on something for me.

Each house I create has a pickup assigned to them on creation, and on load. Each pickup on entered should open up a dialog.

So far, I've got it to get the house ID when they enter it. However, the dialog is being opened every few seconds, it's as if the loop is repeat, but I've broken out the loop.

I'm most likely doing something stupid and haven't noticed it.

Thanks.

Код:
public OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP pickupid)
{
	new Float: x, Float: y, Float: z, i;
	GetPlayerPos(playerid, x, y, z);
	for(i = 1; i < MAX_HOUSES; i++)
	{
		if(IsPlayerInRangeOfPoint(playerid, 1.0, x, y, z))
		{
			if(pickupid == hInfo[i][Pickup])
			{
				format(szString, sizeof(szString), "For Sale: %s", hInfo[i][Name]);
				ShowPlayerDialog(playerid, DIALOG_HOUSE, DIALOG_STYLE_LIST, szString, "Information\nPurchase", "Next", "Close");
				break;
			}
		}
	}
	return 1;
}
Reply
#2

https://sampwiki.blast.hk/wiki/PickupTypes

You should use type 2 when you create your pickup, or else the callback will keep getting called when you're standing there.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)