Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- #define FILTERSCRIPT
- #include <a_samp>
- #if defined FILTERSCRIPT
- #define GRAD2 0xBFC0C2FF
- #define GRAD5 0xBFC0C2FF
- forward ticketsys(string[]); //ticketsystem log
- new reportname[MAX_PLAYER_NAME+1];
- new ticketmsg[256+1];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" GUI Ticket System by HappyMeal");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" GUI Ticket System by HappyMeal");
- print("----------------------------------\n");
- }
- #endif
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/ticket", cmdtext, true, 10) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- GetPlayerName(playerid,reportname,MAX_PLAYER_NAME);
- format(ticketmsg,256,"Herzlich Wilkommen im Ticket System\n\nBenutzer:\t%s\n\nBitte teile uns dein Problem mit:",reportname);
- ShowPlayerDialog(playerid,100,DIALOG_STYLE_INPUT,"Ticket System by HappyMeal",ticketmsg,"Absenden","Verlassen");
- return 1;
- }
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 100)
- {
- if(response)
- {
- new string[256];
- new idx;
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new length = strlen(inputtext);
- while ((idx < length) && (inputtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[64];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = inputtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, GRAD2, "FEHLER !");
- return 1;
- }
- format(string, sizeof(string), " | %s hat ein Ticket hinterlassen: [%s] |", sendername, (result));
- SendClientMessage(playerid, GRAD5, string);
- format(string, sizeof(string), "[TICKET] %s hat ein neues Ticket eingesendet : [%s] |", sendername, (result));
- SendClientMessage(playerid, GRAD2, string);
- ticketsys(string);
- GameTextForPlayer(playerid, "Ticket Gespeichert",5000,3);
- }
- else
- {
- SendClientMessage(playerid, GRAD2, "Ticket System Verlassen");
- }
- return 1;
- }
- return 1;
- }
- public ticketsys(string[])
- {
- new eintragen[256];
- format(eintragen, sizeof(eintragen), "%s\n",string);
- new File:hFile;
- hFile = fopen("tickets.log", io_append);
- fwrite(hFile, eintragen);
- fclose(hFile);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement