Need Help
#1

Hello

I am working on a Prison map for my server, now what i need is,

The house got 4,5 floors, so i need something like "elevator"

So when a player types /elevator near a door, a dialog pops up and he can choose on which floor to teleport

I don't really know how to start with this
Reply
#2

Create a dialog for each floor, in OnPlayerDialogResponse track what they selected and then teleport them to the floor they selected.

pawn Код:
ShowPlayerDialog(playerid, 832, DIALOG_STYLE_LIST, "Which floor?", "1\n2\n3\n4\n5", "Go", "Cancel");
and in OnPlayerDialogResponse:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
 // Assuming you already have dialogs implemented, we'll add an if statement instead of a switch statement.

 if(dialogid == 832) {
   switch(listitem) { // switch here once we've checked which dialogid we're dealing with.
   case 0: SetPlayerPos(playerid, 0, 0, 0); // Floor 1. Replace the coords from 0 0 0 to whatever they should be.
   case 1: SetPlayerPos(playerid, 0, 0, 0); // Floor 2.
   case 2: SetPlayerPos(playerid, 0, 0, 0);  // Floor 3.
   case 3: SetPlayerPos(playerid, 0, 0, 0);  // Floor 4.
   case 4: SetPlayerPos(playerid, 0, 0, 0);  // Floor 5.
  }
 }
}
Reply
#3

Thank you a lot

but now i need the command /elevator
Reply
#4

pawn Код:
if(strcmp("/elevator",cmdtext,true,10) == 0)
{
   ShowPlayerDialog(playerid, 832, DIALOG_STYLE_LIST, "Which floor?", "1\n2\n3\n4\n5", "Go", "Cancel");
   return 1;
}
Reply
#5

Thanks, but where to put the coordinates where the player can type it? because i want it only if he is near the door
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)