Advertisement
Guest User

scripthapylala

a guest
Oct 8th, 2009
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. #define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6.  
  7. #if defined FILTERSCRIPT
  8. #define GRAD2 0xBFC0C2FF
  9. #define GRAD5 0xBFC0C2FF
  10. forward ticketsys(string[]); //ticketsystem log
  11. new reportname[MAX_PLAYER_NAME+1];
  12. new ticketmsg[256+1];
  13.  
  14.  
  15.  
  16. public OnFilterScriptInit()
  17. {
  18. print("\n--------------------------------------");
  19. print(" GUI Ticket System by HappyMeal");
  20. print("--------------------------------------\n");
  21. return 1;
  22. }
  23.  
  24. public OnFilterScriptExit()
  25. {
  26. return 1;
  27. }
  28.  
  29. #else
  30.  
  31. main()
  32. {
  33. print("\n----------------------------------");
  34. print(" GUI Ticket System by HappyMeal");
  35. print("----------------------------------\n");
  36. }
  37.  
  38. #endif
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. public OnPlayerCommandText(playerid, cmdtext[])
  46. {
  47. if (strcmp("/ticket", cmdtext, true, 10) == 0)
  48. {
  49. if(IsPlayerConnected(playerid))
  50. {
  51. GetPlayerName(playerid,reportname,MAX_PLAYER_NAME);
  52. format(ticketmsg,256,"Herzlich Wilkommen im Ticket System\n\nBenutzer:\t%s\n\nBitte teile uns dein Problem mit:",reportname);
  53. ShowPlayerDialog(playerid,100,DIALOG_STYLE_INPUT,"Ticket System by HappyMeal",ticketmsg,"Absenden","Verlassen");
  54. return 1;
  55. }
  56. }
  57. return 0;
  58. }
  59.  
  60.  
  61.  
  62. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  63. {
  64. if(dialogid == 100)
  65. {
  66. if(response)
  67. {
  68. new string[256];
  69. new idx;
  70. new sendername[MAX_PLAYER_NAME];
  71. GetPlayerName(playerid, sendername, sizeof(sendername));
  72. new length = strlen(inputtext);
  73. while ((idx < length) && (inputtext[idx] <= ' '))
  74. {
  75. idx++;
  76. }
  77. new offset = idx;
  78. new result[64];
  79. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  80. {
  81. result[idx - offset] = inputtext[idx];
  82. idx++;
  83. }
  84. result[idx - offset] = EOS;
  85. if(!strlen(result))
  86. {
  87. SendClientMessage(playerid, GRAD2, "FEHLER !");
  88. return 1;
  89. }
  90. format(string, sizeof(string), " | %s hat ein Ticket hinterlassen: [%s] |", sendername, (result));
  91. SendClientMessage(playerid, GRAD5, string);
  92. format(string, sizeof(string), "[TICKET] %s hat ein neues Ticket eingesendet : [%s] |", sendername, (result));
  93. SendClientMessage(playerid, GRAD2, string);
  94. ticketsys(string);
  95. GameTextForPlayer(playerid, "Ticket Gespeichert",5000,3);
  96. }
  97. else
  98. {
  99. SendClientMessage(playerid, GRAD2, "Ticket System Verlassen");
  100. }
  101. return 1;
  102. }
  103. return 1;
  104.  
  105. }
  106. public ticketsys(string[])
  107. {
  108. new eintragen[256];
  109. format(eintragen, sizeof(eintragen), "%s\n",string);
  110. new File:hFile;
  111. hFile = fopen("tickets.log", io_append);
  112. fwrite(hFile, eintragen);
  113. fclose(hFile);
  114. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement