#1

how i can do a PM command with that:

Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
  	new s[128];
  format(s,sizeof(s),"Privet Masasge");
  ShowPlayerDialog(playerid,3,DIALOG_STYLE_LIST,"Massage::",s,"Send","Cancel");
  
	return 1;
}
help pliz
Reply
#2

Use DIALOG_STYLE_INPUT instead of DIALOG_STYLE_LIST and detect the message with the OnDialogResponse callback.
Reply
#3

but how i detect the clickedplayerid on OnDialogResponse??
Reply
#4

you can use something like

Код:
new ClickedPlayerID[MAX_PLAYERS];
then onplayerspawn

Код:
ClickedPlayerID[playerid] = -1; // -1 so it doesnt get a players id
Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
  	new s[128];
  clickedplayerid = ClickedPlayerID[playerid]; 
  format(s,sizeof(s),"Privet Masasge");
  ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"Enter A Message::",s,"Send","Cancel");
  
	return 1;
}
i'm sure you can figure out the rest
Reply
#5

Quote:
Originally Posted by Beaver07
Код:
clickedplayerid = ClickedPlayerID[playerid];
It should be:

Код:
ClickedPlayerID[playerid] = clickedplayerid;
Reply
#6

i want to do alist of commands when you click on player like:
Privet Massage
Player Stats

how i do that?
Reply
#7

Quote:
Originally Posted by HITMANBOY
i want to do alist of commands when you click on player like:
Privet Massage
Player Stats

how i do that?
The same as your first post:

ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"Co mmands","Number 1\nNumber 2\nNumber 3\nNumber 4","Ok","Cancel");

Just look @ the wiki itll explain most of the scripting problems.
Reply
#8

Quote:
Originally Posted by HITMANBOY
i want to do alist of commands when you click on player like:
Privet Massage
Player Stats

how i do that?
Well, make a main menu with DIALOG_STYLE_LIST. Then other dialogs can be created by clicking certain elements of the main menu. For example DIALOG_STYLE_INPUT for Private Message and DIALOG_STYLE_MSGBOX for Player Stats.
Reply
#9

but how i do if i choose in the List Privet Massage it's open a new ShowPlayerDialog and if i choose on the list Give Cash it's open me another ShowPlayerDialog??
Reply
#10

Quote:
Originally Posted by Gergo1352
Quote:
Originally Posted by HITMANBOY
i want to do alist of commands when you click on player like:
Privet Massage
Player Stats

how i do that?
Well, make a main menu with DIALOG_STYLE_LIST. Then other dialogs can be created by clicking certain elements of the main menu. For example DIALOG_STYLE_INPUT for Private Message and DIALOG_STYLE_MSGBOX for Player Stats.
can you give me exmple?
Reply
#11

this is what i use

Код:
new string[256],string2[256];
	new clickedplayer[MAX_PLAYER_NAME];
	ClickedPlayerID[playerid] = clickedplayerid;
  GetPlayerName(clickedplayerid, clickedplayer, sizeof(clickedplayer));
  format(string, sizeof(string), "Player %s (%d) Menu", clickedplayer,clickedplayerid);
  if (PlayerInfo[playerid][pAdmin] == 0)
	{
		format(string2, sizeof(string2), "Stats\nPersonal Message\nGive Money\n");
	}
  if (PlayerInfo[playerid][pAdmin] > 0)
	{
		format(string2, sizeof(string2), "Stats\nPersonal Message\nGive Money\nAdmin Menu");
  }
  ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, string, string2, "Select", "Cancel");
just want to point out that's just a small part of it


Quote:
Originally Posted by Gergo1352
Quote:
Originally Posted by Beaver07
Код:
clickedplayerid = ClickedPlayerID[playerid];
It should be:

Код:
ClickedPlayerID[playerid] = clickedplayerid;
also yes i forgot wrong way round
Reply
#12

Quote:
Originally Posted by HITMANBOY
Quote:
Originally Posted by Gergo1352
Quote:
Originally Posted by HITMANBOY
i want to do alist of commands when you click on player like:
Privet Massage
Player Stats

how i do that?
Well, make a main menu with DIALOG_STYLE_LIST. Then other dialogs can be created by clicking certain elements of the main menu. For example DIALOG_STYLE_INPUT for Private Message and DIALOG_STYLE_MSGBOX for Player Stats.
can you give me exmple?
Example:

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{

if(dialogid == YOURDIALOG) // This is the main menu
{
  if(response)
  {

    if (listitem == 0)
    {
      // Show dialog PRIVATE MESSAGES
    }
    else if (listitem == 1)
    {
      // Show dialog PLAYER STATS
    }
    else if (listitem == 2)
    {
      // Show dialog GIVE CASH
    }
  
  }
}

  return 1;
}
Reply
#13

how i use here:

Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	ClickedPlayer[playerid]=clickedplayerid;
  	new s[128];
  format(s,sizeof(s),"BLABLABLA");
  ShowPlayerDialog(playerid,3,DIALOG_STYLE_LIST,"Privet Massage",s,"Ok","Cancel);
	return 1;
}
how i add more stuff to the List
Reply
#14

Quote:
Originally Posted by HITMANBOY
how i use here:

Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	ClickedPlayer[playerid]=clickedplayerid;
 	new s[128];
  format(s,sizeof(s),"BLABLABLA");
  ShowPlayerDialog(playerid,3,DIALOG_STYLE_LIST,"Privet Massage",s,"Ok","Cancel);
	return 1;
}
how i add more stuff to the List
Use \n for line braking.

For example:

Код:
Private Message\nPlayer Stats\nGive Cash
Reply
#15

i do this:
Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	ClickedPlayer[playerid]=clickedplayerid;
  	new s[128];
  format(s,sizeof(s),"BLABLABLA");
  ShowPlayerDialog(playerid,3,DIALOG_STYLE_LIST,"Private Message\nPlayer Stats\nGive Cash",s,"Ok","Cancel");
	return 1;
}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{

	
 	if(dialogid == 3) // This is the main menu
  {
  if(response)
  {
    if (listitem == 0)
    {
		new s[128];
    format(s,sizeof(s),"Privet Massage:");
    ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"Massage:",s,"Ok","Cancel");
      new str2[128];
      new name[24];
      GetPlayerName(ClickedPlayer[playerid], name, sizeof(name));
      format(str,sizeof(str),"PM To %s [%d]: %s",name,ClickedPlayer[playerid],inputtext);
      SendClientMessage(playerid,COLOR_LIGHTBLUE,str);
      format(str2,sizeof(str2),"PM From %s [%d]: %s",GetName(playerid),playerid,inputtext);
      SendClientMessage(ClickedPlayer[playerid],COLOR_AQUA,str2);
      PlayerPlaySound(ClickedPlayer[playerid],1056,0.0,0.0,0.0);
    }
    else if (listitem == 1)
    {
      new s[128];
      format(s,sizeof(s),"Cash");
      ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"Cash:",s,"Send","Cancel");
			GivePlayerMoney(playerid,350);
    }
    else if (listitem == 2)
    {
      // Show dialog GIVE CASH
    }

  }
}
  return 0;
}
it's print me only BLABLABLA why?
Reply
#16

Seif has made something, find it.
Reply
#17

someone help?
Reply
#18

Up
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)