Marker that opens a dialog to pick location
#1

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.
Reply
#2

AddStaticPickup, OnPlayerPickUpPickup, then ShowPlayerDialog and OnDialogResponse. For teleport SetPlayerPos.
Reply
#3

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

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.
Reply
#5

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();
    }
}
Reply
#6

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)