SA-MP Forums Archive
Dialog Spam - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dialog Spam (/showthread.php?tid=607900)



Dialog Spam - CloudLEL - 25.05.2016

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;
}



Re: Dialog Spam - Stinged - 25.05.2016

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.