Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case DIALOG_PANEL_ACTIONS:
- {
- new szQuery[1024],giverid,actionid,actiontime,complaint,reason[64],stringg[256],playername[30],givername[30],var100[300],dm,reason2[64];
- format(szQuery, sizeof(szQuery), "SELECT * FROM `panelactions`");
- new Cache: stringresult = mysql_query(SQL, szQuery);
- if(cache_get_row_count() > 0)
- {
- for(new i, j = cache_get_row_count (); i != j; ++i)
- {
- playerid = cache_get_field_content_int(i, "playerid");
- giverid = cache_get_field_content_int(i, "giverid");
- actionid = cache_get_field_content_int(i, "actionid");
- actiontime = cache_get_field_content_int(i, "actiontime");
- complaint = cache_get_field_content_int(i, "complaintid");
- dm = cache_get_field_content_int(i, "dm");
- cache_get_field_content(i, "playername", playername, SQL, sizeof(playername));
- cache_get_field_content(i, "givername", givername, SQL, sizeof(givername));
- cache_get_field_content(i, "reason", reason, SQL, sizeof(reason));
- mysql_format(SQL, var100, sizeof(var100), "INSERT INTO panelactions2 (`playerid`,`giverid`,`actionid`,`actiontime`,`complaintid`,`dm`,`playername`,`givername`,`reason`) VALUES ('%d','%d','%d','%d','%d','%d','%s','%s','%s')",playerid,giverid,actionid,actiontime,complaint,dm,playername,givername,reason);
- mysql_tquery(SQL,var100,"","");
- switch(actionid)
- {
- case 1: {
- if(complaint > 0)
- {
- format(stringg,sizeof(stringg),"AdmPanel: %s has been banned by %s for %d days, reason: %s [complaint:%d].",playername,givername,actiontime,reason,complaint);
- SendClientMessageToAll(COLOR_LIGHTRED, stringg);
- format(reason2,sizeof(reason2),"%s [complaint:%d]",reason,complaint);
- }
- else
- {
- format(stringg,sizeof(stringg),"AdmPanel: %s has been banned by %s for %d days, reason: %s.",playername,givername,actiontime,reason);
- SendClientMessageToAll(COLOR_LIGHTRED, stringg);
- format(reason2,sizeof(reason2),"%s",reason);
- }
- mysql_format(SQL, var100, sizeof(var100), "INSERT INTO punishlogs (`playerid`,`giverid`,`actionid`,`actiontime`,`reason`,`playername`,`givername`,`unixtime`) VALUES ('%d','%d','1','%d','%s','%s','%s','%d')",playerid,giverid,actiontime,reason2,playername,givername,gettime());
- mysql_tquery(SQL,var100,"","");
- foreach(new idd : Player)
- {
- if(PlayerInfo[idd][pSQLID] == playerid)
- {
- KickEx(idd);
- }
- }
- }
- case 2: {
- if(complaint > 0)
- {
- format(stringg,sizeof(stringg),"AdmPanel: %s has been permanent banned by %s, reason: %s [complaint:%d].",playername,givername,reason,complaint);
- SendClientMessageToAll(COLOR_LIGHTRED, stringg);
- format(reason2,sizeof(reason2),"%s [complaint:%d]",reason,complaint);
- }
- else
- {
- format(stringg,sizeof(stringg),"AdmPanel: %s has been permanent banned by %s, reason: %s.",playername,givername,reason);
- SendClientMessageToAll(COLOR_LIGHTRED, stringg);
- format(reason2,sizeof(reason2),"%s",reason);
- }
- mysql_format(SQL, var100, sizeof(var100), "INSERT INTO punishlogs (`playerid`,`giverid`,`actionid`,`actiontime`,`reason`,`playername`,`givername`,`unixtime`) VALUES ('%d','%d','2','0','%s','%s','%s','%d')",playerid,giverid,reason2,playername,givername,gettime());
- mysql_tquery(SQL,var100,"","");
- foreach(new idd : Player)
- {
- if(PlayerInfo[idd][pSQLID] == playerid)
- {
- KickEx(idd);
- }
- }
- }
- case 3: {
- if(complaint > 0)
- {
- format(stringg, sizeof(stringg), "AdmPanel: %s was jailed by %s for %d minutes, reason: %s [complaint:%d]",playername,givername,actiontime,reason,complaint);
- SendClientMessageToAll(COLOR_LIGHTRED, stringg);
- format(reason2,sizeof(reason2),"%s [complaint:%d]",reason,complaint);
- }
- else
- {
- format(stringg, sizeof(stringg), "AdmPanel: %s was jailed by %s for %d minutes, reason: %s",playername,givername,actiontime,reason);
- SendClientMessageToAll(COLOR_LIGHTRED, stringg);
- format(reason2,sizeof(reason2),"%s",reason);
- }
- mysql_format(SQL, var100, sizeof(var100), "INSERT INTO punishlogs (`playerid`,`giverid`,`actionid`,`actiontime`,`reason`,`playername`,`givername`,`unixtime`) VALUES ('%d','%d','6','%d','%s','%s','%s','%d')",playerid,giverid,actiontime,reason2,playername,givername,gettime());
- mysql_tquery(SQL,var100,"","");
- foreach(new idd : Player)
- {
- if(PlayerInfo[idd][pSQLID] == playerid)
- {
- ResetPlayerWeapons(idd);
- WantedTime[idd] = 0;
- PlayerInfo[idd][pJailed] = 2;
- PlayerInfo[idd][pJailTime] = actiontime*60;
- SetPlayerInterior(idd, 10);
- if(dm > 0)
- {
- PlayerInfo[idd][pGunLic] = 0;
- PlayerInfo[idd][pGunLicT] = 0;
- }
- }
- }
- }
- case 4: {
- if(complaint > 0)
- {
- format(stringg, sizeof(stringg), "AdmPanel: %s received a warn from admin %s, reason: %s [complaint:%d].",playername,givername,reason,complaint);
- SendClientMessageToAll(COLOR_LIGHTRED, stringg);
- format(reason2,sizeof(reason2),"%s [complaint:%d]",reason,complaint);
- }
- else
- {
- format(stringg, sizeof(stringg), "AdmPanel: %s received a warn from admin %s, reason: %s.",playername,givername,reason);
- SendClientMessageToAll(COLOR_LIGHTRED, stringg);
- format(reason2,sizeof(reason2),"%s",reason);
- }
- mysql_format(SQL, var100, sizeof(var100), "INSERT INTO punishlogs (`playerid`,`giverid`,`actionid`,`actiontime`,`reason`,`playername`,`givername`,`unixtime`) VALUES ('%d','%d','5','%d','%s','%s','%s','%d')",playerid,giverid,actiontime,reason2,playername,givername,gettime());
- mysql_tquery(SQL,var100,"","");
- foreach(new idd : Player)
- {
- if(PlayerInfo[idd][pSQLID] == playerid)
- {
- PlayerInfo[idd][pWarns] += 1;
- }
- }
- format(szQuery, sizeof(szQuery), "SELECT * FROM `users` WHERE `id`='%d' ORDER BY `id`",playerid);
- new Cache: stringresultt = mysql_query(SQL, szQuery);
- if(cache_get_row_count() > 0)
- {
- new warns,str[256],time;
- for(new is, js = cache_get_row_count (); is != js; ++is)
- {
- warns = cache_get_field_content_int(is, "Warnings");
- }
- if(warns == 1)
- {
- mysql_format(SQL,str,sizeof(str),"UPDATE `users` SET `WarnReason1` = '%s' WHERE `name`='%s'",reason,playername);
- mysql_tquery(SQL,str,"","");
- }
- else if(warns == 2)
- {
- mysql_format(SQL,str,sizeof(str),"UPDATE `users` SET `WarnReason2` = '%s' WHERE `name`='%s'",reason,playername);
- mysql_tquery(SQL,str,"","");
- }
- else if(warns > 2)
- {
- format(stringg, sizeof(stringg), "AdmPanel: %s has been banned by AdmBot for 3 days, reason: 3/3 warns.",playername);
- time = gettime() + (3*86400);
- mysql_format(SQL,str,sizeof(str),"INSERT INTO bans (PlayerName, AdminName, Reason, IP, Days, IPBan, Permanent, Active, Time) VALUES('%s', 'AdmBot', '3/3 warns', '0', 3, 0, 0, 1, %d)",
- playername,time);
- mysql_tquery(SQL,str,"","");
- mysql_format(SQL,str,sizeof(str),"UPDATE `users` SET `Warnings`='0', `WarnReason1` = '(null)', `WarnReason2` = '(null)' WHERE `name`='%s'",playername);
- mysql_tquery(SQL,str,"","");
- mysql_format(SQL, var100, sizeof(var100), "INSERT INTO punishlogs (`playerid`,`giverid`,`actionid`,`actiontime`,`reason`,`playername`,`givername`,`unixtime`) VALUES ('%d','0','1','3','3/3 warns','%s','AdmBot','%d')",playerid,playername, gettime());
- mysql_tquery(SQL,var100,"","");
- SendClientMessageToAll(COLOR_LIGHTRED, stringg);
- foreach(new idd : Player)
- {
- if(PlayerInfo[idd][pSQLID] == playerid)
- {
- format(stringg, sizeof(stringg), "You have received an warn from admin %s, reason: %s", givername, reason);
- SendClientMessage(idd, COLOR_RED, stringg);
- KickEx(idd);
- }
- }
- }
- }
- cache_delete(stringresultt);
- }
- case 5: {
- if(complaint > 0)
- {
- format(stringg, sizeof(stringg), "AdmPanel: %s has been muted by %s for %d minutes, reason: %s [complaint:%d].",playername,givername,actiontime,reason,complaint);
- SendAdminMessage(COLOR_LIGHTRED, stringg, 1);
- format(reason2,sizeof(reason2),"%s [complaint:%d]",reason,complaint);
- }
- else
- {
- format(stringg, sizeof(stringg), "AdmPanel: %s has been muted by %s for %d minutes, reason: %s.",playername,givername,actiontime,reason);
- SendAdminMessage(COLOR_LIGHTRED, stringg, 1);
- format(reason2,sizeof(reason2),"%s",reason);
- }
- mysql_format(SQL, var100, sizeof(var100), "INSERT INTO punishlogs (`playerid`,`giverid`,`actionid`,`actiontime`,`reason`,`playername`,`givername`,`unixtime`) VALUES ('%d','%d','7','%d','%s','%s','%s','%d')",playerid,giverid,actiontime,reason2,playername,givername,gettime());
- mysql_tquery(SQL,var100,"","");
- foreach(new idd : Player)
- {
- if(PlayerInfo[idd][pSQLID] == playerid)
- {
- PlayerInfo[idd][pMuted] = 1;
- PlayerInfo[idd][pMuteTime] = actiontime*60;
- format(stringg, sizeof(stringg), "* You were muted by Admin %s for %d minutes, reason: %s.", givername, actiontime, reason);
- SendClientMessage(idd, COLOR_RED, stringg);
- }
- }
- }
- case 6: {
- if(complaint > 0)
- {
- format(stringg, sizeof(stringg), "AdmPanel: %s has been kicked by %s, reason: %s [complaint:%d].",playername,givername,reason,complaint);
- SendClientMessageToAll(COLOR_LIGHTRED, stringg);
- format(reason2,sizeof(reason2),"%s [complaint:%d]",reason,complaint);
- }
- else
- {
- format(stringg, sizeof(stringg), "AdmPanel: %s has been kicked by %s, reason: %s.",playername,givername,reason);
- SendClientMessageToAll(COLOR_LIGHTRED, stringg);
- format(reason2,sizeof(reason2),"%s",reason);
- }
- mysql_format(SQL, var100, sizeof(var100), "INSERT INTO kicklogs (`playerid`,`giverid`,`playername`,`givername`,`reason`) VALUES ('%d','%d','%s','%s','%s')", playerid,giverid,playername,givername,reason2);
- mysql_tquery(SQL,var100,"","");
- foreach(new idd : Player)
- {
- if(PlayerInfo[idd][pSQLID] == playerid)
- {
- KickEx(idd);
- }
- }
- }
- }
- }
- }
- mysql_query(SQL,"DELETE FROM `panelactions`");
- cache_delete(stringresult);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement