Advertisement
kaZax

[FS] kReport

May 16th, 2013
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.37 KB | None | 0 0
  1. #include a_samp.inc
  2. #include mailer.inc
  3.  
  4. #define DIALOG_REPORT 1478
  5. #define AdminMail "kazax.samp@gmail.com"
  6. public OnFilterScriptInit()
  7. {
  8.     printf("kReport: Loaded");
  9.     return true;
  10. }
  11. public OnFilterScriptExit()
  12. {
  13.     printf("kReport: UnLoaded");
  14.     return true;
  15. }
  16. public OnPlayerCommandText(playerid, cmdtext[])
  17. {
  18.     if(strcmp(cmdtext, "/репорт", true) == 0 || strcmp(cmdtext, "/report", true) == 0)
  19.     {
  20.         ShowPlayerDialog(playerid,DIALOG_REPORT, DIALOG_STYLE_INPUT, "Репорт", "Введите ваше сообщение администраторам:", "Отправить", "Отмена");
  21.         return true;
  22.     }
  23.     return false;
  24. }
  25. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  26. {
  27.     if(dialogid == DIALOG_REPORT)
  28.     {
  29.         if(!response)SendClientMessage(playerid, 0xFFFFFFFF, "Вы отменили действие!");
  30.         new hour,minute,second,str[256],name[MAX_PLAYER_NAME+1],day,month,year;
  31.         GetPlayerName(playerid, name, sizeof(name));
  32.         gettime(hour,minute,second);
  33.         getdate(year,month,day);
  34.         format(str,256,"Новый репорт:\nНик игрока: %s\nТекст: %s\nВремя отправки: %02d:%02d\nДата: %02d.%02d.%d",name,inputtext,hour,minute,day,month,year);
  35.         SendMail( AdminMail, "kReportSystem@", name, "kaZax", str);
  36.         return true;
  37.     }
  38.     return false;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement