Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////////////////////////////////////////////////////////////////////////////////
- /*
- Complaint Systém by nVidiaX.
- Version: 1.0
- Last Update: 17.6.2012 v 18:22
- */
- ////////////////////////////////////////////////////////////////////////////////
- #include <a_samp>
- ////////////////////////////////////////////////////////////////////////////////
- #define COLOR_WHITE "{FFFFFF}"
- #define COLOR_RED "{F81414}"
- #define COLOR_GREEN "{00FF22}"
- ////////////////////////////////////////////////////////////////////////////////
- #define DIALOG_COMPLAINTS_INPUT 990
- #define DIALOG_COMPLAINTS_ADMIN_MENU 991
- #define DIALOG_COMPLAINTS_LIST 992
- ////////////////////////////////////////////////////////////////////////////////
- public OnPlayerCommandText(playerid,cmdtext[])
- {
- if(strcmp(cmdtext, "/report", true, 7) == 0)
- {
- ShowPlayerDialog(playerid, DIALOG_COMPLAINTS_INPUT, DIALOG_STYLE_INPUT, ""COLOR_WHITE"Complaint", ""COLOR_WHITE"Write Your Complaint.", "Send", "Close");
- return 1;
- }
- if(strcmp(cmdtext, "/admin", true, 6) == 0)
- {
- if(!IsPlayerAdmin(playerid)) return 0;
- ShowPlayerDialog(playerid, DIALOG_COMPLAINTS_ADMIN_MENU, DIALOG_STYLE_LIST, ""COLOR_WHITE"Complaint Administration", ""COLOR_WHITE"Complaints List", "Select", "Close");
- return 1;
- }
- if(strcmp(cmdtext, "/about", true, 7) == 0)
- {
- ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, ""COLOR_WHITE"About Complaints System", ""COLOR_WHITE"Complaints System v1.0 by "COLOR_GREEN"nVidiaX"COLOR_WHITE".\n\nCommand: /report , /admin , /about.\n\nWhat Have This System:\n - Administration\n - Easy Writing Complaint\n\nThank You For Using My System!\n\n"COLOR_GREEN"nVidiaX"COLOR_WHITE".", "Close", "");
- return 1;
- }
- return 0;
- }
- ////////////////////////////////////////////////////////////////////////////////
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- //Nahlášení problému.
- if(dialogid == DIALOG_COMPLAINTS_INPUT && response)
- {
- if(strlen(inputtext) < 3) return ShowPlayerDialog(playerid, DIALOG_COMPLAINTS_INPUT, DIALOG_STYLE_INPUT, ""COLOR_WHITE"Complaint", ""COLOR_RED"You Don't Writed Your Complaint.","Send","Close");
- new Year, Month, Day, Hour, Minute, Second;
- getdate(Year,Month,Day); gettime(Hour,Minute,Second);
- new String[128];
- format(String,sizeof(String),"[%d/%d/%d v %02d:%02d] %s: %s\r\n",Day,Month,Year,Hour,Minute,Jmeno(playerid),inputtext);
- for(new f = 0; f < 20; f++)
- {
- new Filec[25];
- format(Filec, sizeof(Filec), "/Complaints/%d.txt", f);
- if(fexist(Filec)) continue;
- if(!fexist(Filec))
- {
- fcreate(Filec);
- new File:FileC = fopen(Filec, io_write);
- fwrite(FileC, String);
- fclose(FileC);
- break;
- }
- }
- ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, ""COLOR_WHITE"Complaint", ""COLOR_GREEN"Thank You For Report a Complaint.", "Close", "");
- }
- //Administrace problémů.
- if(dialogid == DIALOG_COMPLAINTS_ADMIN_MENU && response)
- {
- if(listitem == 0)
- {
- new String[1200];
- new StringF[256];
- new Files = 0;
- for(new f = 0; f < 20; f++)
- {
- new Filec[25];
- format(Filec, sizeof(Filec), "/Complaints/%d.txt", f);
- if(fexist(Filec))
- {
- Files ++;
- new File:ReadF = fopen(Filec, io_read);
- fread(ReadF, StringF);
- format(String, sizeof(String), "%s\n%s", String, StringF);
- fclose(ReadF);
- }
- }
- if(Files > 0)
- {
- ShowPlayerDialog(playerid, DIALOG_COMPLAINTS_LIST, DIALOG_STYLE_LIST, ""COLOR_WHITE"Complaints Administration", String, "Select", "Close");
- }else{
- ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, ""COLOR_WHITE"Complaints Administration", "Any Files Not Exist.", "Close", "");
- }
- }
- }
- return 1;
- }
- ////////////////////////////////////////////////////////////////////////////////
- stock Jmeno(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- return name;
- }
- ////////////////////////////////////////////////////////////////////////////////
- stock fcreate(file[])
- {
- if(fexist(file)) return false;
- new File:cFile = fopen(file,io_write);
- return fclose(cFile);
- }
- ////////////////////////////////////////////////////////////////////////////////
- /*
- (c)2012 by nVidiaX & Complaint Systém.
- */
- ////////////////////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement