Need Help - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need Help (
/showthread.php?tid=200827)
Need Help -
Farid - 19.12.2010
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
Re: Need Help -
__ - 19.12.2010
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.
}
}
}
Re: Need Help -
Farid - 19.12.2010
Thank you a lot
but now i need the command /elevator
Re: Need Help -
blackwave - 19.12.2010
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;
}
Re: Need Help -
Farid - 19.12.2010
Thanks, but where to put the coordinates where the player can type it? because i want it only if he is near the door