SA-MP Forums Archive
Marker that opens a dialog to pick location - 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: Marker that opens a dialog to pick location (/showthread.php?tid=407583)



Marker that opens a dialog to pick location - mikkidan - 14.01.2013

Hi, I'm trying to make a marker that, when a player enters it, opens a list dialog and ask if the player wants to go to transfender, Loco Low Co. or Wheel Arch Angels. So, if anyone could help me, since all I know about scripting is that it's typed on computers. Thanks in advance.


Re: Marker that opens a dialog to pick location - Diorturato - 14.01.2013

AddStaticPickup, OnPlayerPickUpPickup, then ShowPlayerDialog and OnDialogResponse. For teleport SetPlayerPos.


Re: Marker that opens a dialog to pick location - mikkidan - 14.01.2013

Sound good^^ But can you give me an example code?


Re: Marker that opens a dialog to pick location - [KHK]Khalid - 14.01.2013

https://sampwiki.blast.hk/wiki/Function:SetPlayerCheckpoint - to create a red marker for a player (Or create a dynamic one if you've a streamer).
https://sampwiki.blast.hk/wiki/OnPlayerEnterCheckpoint - to detect when a player enters a checkpoint.
https://sampwiki.blast.hk/wiki/ShowPlayerDialog - to show a player a dialogbox.
https://sampwiki.blast.hk/wiki/OnDialogResponse - to handle responses to that dialogbox.


Re: Marker that opens a dialog to pick location - Diorturato - 14.01.2013

pawn Код:
new mymaker = AddStaticPickup(1242, 1, 1503.3359, 1432.3585, 10.1191, 0);

public OnPlayerPickUpPickup(playerid, pickupid) {
    if(pickupid == mymarker) ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Weapons", "TransFender\nLoco Low Co.\nWheel Arch Angels", "Teleport", "Exit");
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
    if(dialogid == 777) {
        if(listitem == 0) // TransFender
            // SetPlayerPos();
        else if(listitem == 1) // Loco Low Co.
            // SetPlayerPos();
        else if(listitem == 2) // Wheel Arch Angels
            // SetPlayerPos();
    }
}



Re: Marker that opens a dialog to pick location - mikkidan - 14.01.2013

Could you maybe give me a .pwn file, because I simply can't get this to compile^^


Re: Marker that opens a dialog to pick location - Diorturato - 14.01.2013

This is just an example, it will not work without all params.


Re: Marker that opens a dialog to pick location - mikkidan - 14.01.2013

Can you please make a fully working code? I can set the co-ordinates later