PDA

View Full Version : OnPlayerPickup


Ugaustin
04/07/2015, 08:53 PM
hello I need help .. players that have id 0 are getting spammed with dialog..


public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == Burger)
{
ShowPlayerDialog(playerid,DIALOG_Burger,DIALOG_STY LE_LIST,..);
}
return 1;
}

Blademaster680
04/07/2015, 09:44 PM
That would be because it sees that they are on the pickup so it will resent that dialog. Try run a timer or something to check if that dialog is open, if its not then show them the dialog

kyriakos587
04/07/2015, 11:41 PM
You have to make this:


new ShowDIalog[MAX_PLAYERS]; // add this somewhere in GameMode

public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == Burger && ShowDialog[playerid] == 0)
{
ShowDialog[playerid] = 1;
ShowPlayerDialog(playerid,DIALOG_Burger,DIALOG_STY LE_LIST,..);
}
return 1;
}


and after when he close the dialog make it ShowDialog[playerid] = 0; again...
if you dont know how to do this, send me the code in pm if you want to help you to make..(remember i want the code that you have add on OnPlayerDialogResponse..)