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



onplayerpickuppickup - M.5 - 28.09.2011

Hi, i have this command done so far but i have never worked with GUI yet because i have been left and i came back. Can you help me to make if player pickup that pickup it will give him GUI to choose if he wants to move object for money or not when they open it i want it to close in 10sec.

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == mypickup)
    {

        MoveObject(object01,72.232567, -1533.768188, 6.978306, 1.0001);
        GetPlayerMoney(playerid, 100);
    }
    return 1;
}
Thanks you!


Re: onplayerpickuppickup - Azzeto - 29.09.2011

Well if you want to do a dialog when they enter the pickup then...
pawn Код:
//Top of script
new mypickup;
#define DIALOG_MOVEOBJECT
//OnPlayerPickupPickup
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == mypickup)
    {

        ShowPlayerDialog(playerid,DIALOG_MOVEOBJECT,DIALOG_STYLE_LIST,"Move Object","Move Object\nNo Thanks","Confirm","Cancel");
    }
    return 1;
}
//public Ondialogresponse
if(dialogid == DIALOG_SHOP)
{
if(response == 1)// They pressed the first button.
{
    switch(listitem)// Checking which listitem was selected
            {
                case 0:
                {
                    MoveObject(object01,72.232567, -1533.768188, 6.978306, 1.0001);
                    GetPlayerMoney(playerid, 100);
                }
                case 1:
                {
                     //leave blank to close the dialog when chose.
                }
            }
}
}
Hope I helped!


Re: onplayerpickuppickup - M.5 - 29.09.2011

Yes thanks, but do you know how to make timer that it will close after 10sec