07.07.2011, 13:54
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd,"/ask",true)==0 || strcmp(cmd,"/askq",true)==0 || strcmp(cmd,"/report",true)==0)
{
ShowPlayerDialog(playerid,489,DIALOG_STYLE_INPUT,"REPORT:","Enter your message below", "Send", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 489)
{
if(response)
{
new string[128];
GetPlayerName(playerid, string, 24);
if(!strlen(inputtext)) return ShowPlayerDialog(playerid,489,DIALOG_STYLE_INPUT,"REPORT:","Enter your message below", "Send", "Cancel");
if(strlen(inputtext) > 90)
{
SendClientMessage(playerid, 0xFF0000FF, "Your message must have less than 90 characters.");
ShowPlayerDialog(playerid,489,DIALOG_STYLE_INPUT,"REPORT:","Enter your message below", "Send", "Cancel");
return 1;
}
format(string, 128, "Ask from %s: %s", string, inputtext);
ABroadCast(COLOR_ASKQ,string,1);
SendClientMessage(playerid, COLOR_ASKQ, "Your Q is sent to Admins.");
}
}
return 1;
}