[HELP]Create a country menu
#1

How can i create a country menu?
i have this system:
pawn Code:
new city = 1; // 1 = Los Santos, 2 = San Fierro, 3 = DIE!
when he login there come's a menu:
San Fierro
Los Santos
When he select San Fierro the city become's 2 by him
When he select Los Santos the city become's 2 for him
i don't understand the wiki from showplayerdialog, so don't say:
wiki.sa-mp.com
Reply
#2

Post your code so we can see what's wrong.
Reply
#3

i have nothing do wrong
i just asking if you can make something like that
but i am now here:
pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if(dialogid == 1)
  {
    if(!response) SendClientMessage(playerid, 0xFFFFFFFF, "You canceled!");
    new message[196];
    format(message, sizeof(message), "You are teleported to: %s", inputtext);
    SendClientMessage(playerid, 0xFFFFFFFF, message);
    return 1;
  }
  return 0;
}
and the dialog:
pawn Code:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"City Spawn","San Fierro\nLos Santos","Spawn","Cancel");
how to make now that if he select: Los santos
he goes to a position?
Reply
#4

Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {

  if (dialogid == 1) {
    if (!response) {SendClientMessage(playerid, 0xFFFFFFFF, "You canceled!"); return false;}
    new message[196];
    format(message, sizeof(message), "You are teleported to: %s", inputtext);
    SendClientMessage(playerid, 0xFFFFFFFF, message);

    if (listitem == 1) {SetPlayerPos(playerid, x, y, z);} //san fiero
    else if (listitem == 2) {SetPlayerPos(playerid, x, y, z);} //los santos

    return true;
  }

  return false;
}
You need to decide where to teleport the player due to listitem value. I'm not sure if first item in list starts with 0 or 1, in the example I presumed it starts with 1.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)