Where would I put this? [Dialog]
#1

I got this code:
pawn Код:
if(strcmp(cmd, "/pm", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            ShowPlayerDialog (playerid, 755, DIALOG_STYLE_INPUT, "Private Messaging", "Enter the player ID to send a message to:", "Next", "Cancel");
        return 1;
        }
        return 1;
    }
pawn Код:
new s1[94], s2[94], name[20];
  if (dialogid == entermessage)
  {
    ReceiverID [playerid] = strval (inputtext);
    ShowPlayerDialog (playerid, recievedmessage, DIALOG_STYLE_INPUT, "Private Messaging", "Write the message you want to send:"," Send "," Cancel ");
    return 1;
  }
  if (dialogid == recievedmessage)
  {
GetPlayerName (playerid, name, sizeof (name));
format (s1, sizeof (s1), "You received a private message from: %s \n\n%s", name, inputtext);
format (s2, sizeof (s2), "New private messages %s (%d)", name, playerid);
ShowPlayerDialog (ReceiverID [playerid], recievedmessage2, DIALOG_STYLE_MSGBOX, s2, s1, "Reply", "Cancel");
    return 1;
  }
  if (dialogid == recievedmessage)
  {
GetPlayerName (playerid, name, sizeof (name));
format (s1, sizeof (s1), "You received a private message from: %s \n\n%s", name, inputtext);
format (s2, sizeof (s2), "New private messages %s (% d)", name, playerid);
ShowPlayerDialog (ReceiverID [playerid], recievedmessage, DIALOG_STYLE_MSGBOX, s2, s1, "Reply", "Cancel");
    return 1;
  }
But where would I put it?
Reply
#2


This you put under OnPlayerCommandText
Код:
if(strcmp(cmd, "/pm", true) == 0)
{
  if(IsPlayerConnected(playerid))
  {
  	 ShowPlayerDialog (playerid, 755, DIALOG_STYLE_INPUT, "Private Messaging", "Enter the player ID to send a message to:", "Next", "Cancel");
    return 1;
}
return 1;
}
Place this some where you like

Код:
new s1[94], s2[94], name[20];
  if (dialogid == entermessage)
  {
    ReceiverID [playerid] = strval (inputtext);
    ShowPlayerDialog (playerid, recievedmessage, DIALOG_STYLE_INPUT, "Private Messaging", "Write the message you want to send:"," Send "," Cancel ");
    return 1;
  }
  if (dialogid == recievedmessage)
  {
GetPlayerName (playerid, name, sizeof (name));
format (s1, sizeof (s1), "You received a private message from: %s \n\n%s", name, inputtext);
format (s2, sizeof (s2), "New private messages %s (%d)", name, playerid);
ShowPlayerDialog (ReceiverID [playerid], recievedmessage2, DIALOG_STYLE_MSGBOX, s2, s1, "Reply", "Cancel");
    return 1;
  }
  if (dialogid == recievedmessage)
  {
GetPlayerName (playerid, name, sizeof (name));
format (s1, sizeof (s1), "You received a private message from: %s \n\n%s", name, inputtext);
format (s2, sizeof (s2), "New private messages %s (% d)", name, playerid);
ShowPlayerDialog (ReceiverID [playerid], recievedmessage, DIALOG_STYLE_MSGBOX, s2, s1, "Reply", "Cancel");
    return 1;
  }
Reply
#3

The first script goes into OnPlayerCommandText, the second goes into OnDialogResponse callback.
Reply
#4

I get these:
Код:
C:\Users\James\Desktop\SAMP\gamemodes\roleplay.pwn(798) : error 017: undefined symbol "entermessage"
C:\Users\James\Desktop\SAMP\gamemodes\roleplay.pwn(800) : error 017: undefined symbol "ReceiverID"
C:\Users\James\Desktop\SAMP\gamemodes\roleplay.pwn(800) : error 001: expected token: ";", but found "]"
C:\Users\James\Desktop\SAMP\gamemodes\roleplay.pwn(800) : error 029: invalid expression, assumed zero
Reply
#5

You are missing some dialogs.
Reply
#6

Hmm, could you help me create them?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)