08.06.2016, 05:57
hi guys, anyone knows how i can create mine /report sytem? i know how to use ini save system , i am saving players stats with it, but how i can save whatevr players reports?
Thanks
Thanks
CMD:report(playerid, params[]) { new message[128],admins=0; if(sscanf(params, "s[128]", message)) return SCM(playerid, COLOR_GREY, SYNTAX_MESSAGE"/report [text]"); { foreach(Player, i) { if(PlayerData[i][pAdmin] >= 1) { admins++; } } if(admins == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: There are no admins online."); new string128[256]; format(string128, sizeof(string128), "Your report message was sent to admins."); SendClientMessage(playerid, 0xFFFFFFFF, string128); format(string128, sizeof(string128), "Report from %s [%d]: %s.",PlayerInfo[playerid][pNormalName],playerid, message); submitToAdmins(string128,COLOR_LIGHTRED); PlayerInfo[playerid][pReported] = 1; format(PlayerInfo[playerid][pReportMessage], 256,"%s", string128); } return 1; }
CMD:reports(playerid, params[]) { new count = 0; if(PlayerInfo[playerid][pAdmin] >= 1) { foreach(Player, i) { if(PlayerInfo[i][pReported] == 1) { SCM(playerid, COLOR_LIGHTRED, PlayerInfo[i][pReportMessage]); count++; } } format(szMessage,256, "Total reports: %d", count); SCM(playerid, -1, szMessage); } return 1; }