public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == postoffice)
{
//attempt to show dialogs here...
}
return 1;
}
new SendToID[MAX_PLAYERS];
ShowPlayerDialog(playerid,dialogid,DIALOG_STYLE_INPUT,"PM","Type in the playerid you want to send a message to:","Send","Cancel");
if(dialogid == dialogid)
{
if(!response) return 1;
if(!IsNumeric(inputtext)) return ShowPlayerDialog(playerid,dialogid,DIALOG_STYLE_INPUT,"PM","Error: ID must be a number!\nType in the playerid you want to send a message to:","Send","Cancel");
if(!IsPlayerConnected(inputtext)) return ShowPlayerDialog(playerid,dialogid,DIALOG_STYLE_INPUT,"PM","Error: Player offline!\nType in the playerid you want to send a message to:","Send","Cancel");
SendToID[playerid] = inputtext;
new string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(inputtext,name,sizeof(name));
format(string,sizeof(string),"Alright, type the message you want to send to %s",name);
ShowPlayerDialog(playerid,dialogid,DIALOG_STYLE_INPUT,"PM",string,"Send","Cancel");
}
if(dialogid == dialogid) // DIALOG ID OF ^
{
if(!response)
{
SendToID[playerid] = -1;
return 1;
}
new string[256];
new name1[MAX_PLAYER_NAME];
new name2[MAX_PLAYER_NAME];
GetPlayerName(playerid,name1,sizeof(name1));
GetPlayerName(SendToID[playerid],name2,sizeof(name2));
format(string,sizeof(string),"PM from %s: %s",name1,inputtext);
SendClientMessage(SendToID[playerid],color,string);
format(string,sizeof(string),"PM sent to %s: %s",name2,inputtext);
SendClientMessage(playerid,color,string);
}
SendToID[playerid] = inputtext;
SendToID[playerid] = strval(inputtext);
|
Originally Posted by Baked-Banana
I think
pawn Код:
pawn Код:
|
|
Originally Posted by Coole[AG
]
Top of script: Код:
new SendToID[MAX_PLAYERS]; Код:
ShowPlayerDialog(playerid,dialogid,DIALOG_STYLE_INPUT,"PM","Type in the playerid you want to send a message to:","Send","Cancel"); Код:
if(dialogid == dialogid)
{
if(!response) return 1;
if(!IsNumeric(inputtext)) return ShowPlayerDialog(playerid,dialogid,DIALOG_STYLE_INPUT,"PM","Error: ID must be a number!\nType in the playerid you want to send a message to:","Send","Cancel");
if(!IsPlayerConnected(inputtext)) return ShowPlayerDialog(playerid,dialogid,DIALOG_STYLE_INPUT,"PM","Error: Player offline!\nType in the playerid you want to send a message to:","Send","Cancel");
SendToID[playerid] = inputtext;
new string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(inputtext,name,sizeof(name));
format(string,sizeof(string),"Alright, type the message you want to send to %s",name);
ShowPlayerDialog(playerid,dialogid,DIALOG_STYLE_INPUT,"PM",string,"Send","Cancel");
}
if(dialogid == dialogid) // DIALOG ID OF ^
{
if(!response)
{
SendToID[playerid] = -1;
return 1;
}
new string[256];
new name1[MAX_PLAYER_NAME];
new name2[MAX_PLAYER_NAME];
GetPlayerName(playerid,name1,sizeof(name1));
GetPlayerName(SendToID[playerid],name2,sizeof(name2));
format(string,sizeof(string),"PM from %s: %s",name1,inputtext);
SendClientMessage(SendToID[playerid],color,string);
format(string,sizeof(string),"PM sent to %s: %s",name2,inputtext);
SendClientMessage(playerid,color,string);
}
|