pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/eventrequest", cmdtext, true, 13) == 0)
{
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Select the event", "Event 1\nEvent 2\nEvent 3", "Send", "Close");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 0)
{
if(response)
{
new string[100], name[MAX_PLAYER_NAME], event = listitem+1;
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s requested Event %d", name, event);
//SendMessageToAllAdmins(string);
}
}
return 1;
}
obviously replace the //SendMessageToAllAdmins with your function to send a msg to all admins...
If you want a complete working system, you'd better use the script request section.
example for sending a message to all admins
pawn Код:
stock SendMessageToAllAdmins(text[])
{
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(PlayerData[i][AdminLevel] > 0) //replace this with your definition of admins
{
SendClientMessage(i, 0x99999AA, text);
}
}
}
return 1;
}