SA-MP Forums Archive
OnPlayerPickup - 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: OnPlayerPickup (/showthread.php?tid=580375)



OnPlayerPickup - Ugaustin - 04.07.2015

hello I need help .. players that have id 0 are getting spammed with dialog..


PHP код:
public OnPlayerPickUpPickup(playeridpickupid)
                    {
                        if(
pickupid == Burger)
                        {
                               
ShowPlayerDialog(playerid,DIALOG_Burger,DIALOG_STYLE_LIST,..);
                        }
                        return 
1;
                    } 



Re: OnPlayerPickup - Blademaster680 - 04.07.2015

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


Re: OnPlayerPickup - kyriakos587 - 04.07.2015

You have to make this:

Quote:

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..)