28.01.2017, 04:56
Can anyone help me. how to create a muli dialog.
|
What do you mean? Do you have any screenshots or can you explain?
|
if(dialogid == 97)
{
if(response)
{
new string[128], query[128];
format(string, sizeof(string), "You had set your message to: %s", inputtext);
SendClientMessage(playerid, -1, string);
format(PlayerInfo[playerid][personalmsg], 128, "%s", inputtext);
//save player account
mysql_format(mysql, query, sizeof(query), "UPDATE `accounts` SET `SCORE`= %i , `Admin` = '%i' , `personalmsg` = '%e' WHERE `ID` = '%d'", GetPlayerScore(playerid), PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][personalmsg], PlayerInfo[playerid][ID]);
mysql_query(mysql, query);
print(query);
return 1;
}
}
CMD:cp(playerid,params[]) cp = Control Panel
{
ShowPlayerDialog(playerid,97,DIALOG_STYLE_INPUT,"Join Message","Enter the new join message you want to set","Set","Close");
return 1;
}
enum p_data
{
personalmsg[128]//make sure you've added this array which makes it a string later
};
new PlayerInfo[MAX_PLAYERS][p_data];
public OnPlayerConnect(playerid)
{
new
str[126];
format(str, sizeof(str), "Your personal message is: %s", PlayerInfo[playerid][personalmsg]);
SendClientMessage(playerid, -1, str);
//or show him a dialog if you want.
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_MSGBOX, "Personal Message", str, "Close", "");
return true;
}
|
I guess you have already done what you want. just send this message when he connects, like
pawn Код:
|