Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package mute
- {
- function GameConnection::autoAdminCheck(%client)
- {
- if($muted[%client.getBLID()] == true)
- {
- %time = $time[%client.getBLID()];
- $left[%client.getBLID()] = false;
- $muteSchedule[%client.getBLID()] = schedule(%time, 0, muteTimeUp, %client);
- }
- return parent::autoAdminCheck(%client);
- }
- function serverCmdsilence(%client, %victim, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13, %a14, %a15, %a16, %a17, %a18, %a19, %a20, %a21, %a22, %a23, %a24, %a25, %a26, %a27, %a28, %a29, %a30, %a31, %a32)
- {
- if(%client.isAdmin || %client.isSuperAdmin)
- {
- if(%victim $= "")
- {
- messageClient(%client, '',"You must enter a target!");
- return;
- }
- %victim = findClientByName(%victim);
- if(%victim != 0)
- {
- if(%client.isAdmin)
- {
- if(%victim.isSuperAdmin)
- {
- messageClient(%client,'',"You cannot silence super admins!");
- return;
- }
- }
- if(%victim.isHost)
- {
- messageClient(%client, '',"You cannot silence the host!");
- return;
- }
- if($silence[%victim.getBLID()] == true)
- {
- messageClient(%client,'',"This person has already been silenced.");
- return;
- }
- if($mute[%victim.getBLID()] == true)
- {
- messageClient(%client,'',"This person has already been muted, they cannot be silenced.");
- return;
- }
- %msg = %a1 SPC %a2 SPC %a3 SPC %a4 SPC %a5 SPC %a6 SPC %a7 SPC %a8 SPC %a9 SPC %a10 SPC %a11 SPC %a12 SPC %a13 SPC %a14 SPC %a15 SPC %a16 SPC %a17 SPC %a18 SPC %a19 SPC %a20 SPC %a21 SPC %a22 SPC %a23 SPC %a24 SPC %a25 SPC %a26 SPC %a27 SPC %a28 SPC %a29 SPC %a30 SPC %a31 SPC %a32;
- %msg = strreplace(%msg,"_"," ");
- %msg = stripTrailingSpaces(%msg);
- if(%msg $= "")
- {
- messageAll( 'MsgAdminForce', '\c3%1\c6 has been silenced by \c3%2\c6!', %victim.name, %client.name);
- }
- else
- {
- messageAll( 'MsgAdminForce', '\c3%1\c6 has been silenced by \c3%2\c6 for "\c3%3\c6"', %victim.name, %client.name, %msg);
- }
- $silence[%victim.getBLID()] = true;
- }
- else
- {
- messageClient(%client,'',"Player not found!");
- }
- }
- else
- {
- messageClient(%client, '',"You do not have permission to use this command!");
- return;
- }
- }
- function serverCmdmute(%client, %victim, %time, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13, %a14, %a15, %a16, %a17, %a18, %a19, %a20, %a21, %a22, %a23, %a24, %a25, %a26, %a27, %a28, %a29, %a30, %a31, %a32)
- {
- if(%client.isAdmin || %client.isSuperAdmin)
- {
- if(%victim $= "")
- {
- messageClient(%client, '',"You must enter a target!");
- return;
- }
- %victim = findClientByName(%victim);
- if(isObject(%victim))
- {
- if (%time < 5 || %time > 999)
- {
- messageClient(%client, '',"Mute time cannot be less than five or greater than 999!");
- return;
- }
- if($muted[%victim.getBLID()] == true)
- {
- messageClient(%client,'',"This person has already been muted.");
- return;
- }
- if($silence[%victim.getBLID()] == true)
- {
- messageClient(%client,'',"This person has already been silenced, they cannot be muted.");
- return;
- }
- %msg = %a1 SPC %a2 SPC %a3 SPC %a4 SPC %a5 SPC %a6 SPC %a7 SPC %a8 SPC %a9 SPC %a10 SPC %a11 SPC %a12 SPC %a13 SPC %a14 SPC %a15 SPC %a16 SPC %a17 SPC %a18 SPC %a19 SPC %a20 SPC %a21 SPC %a22 SPC %a23 SPC %a24 SPC %a25 SPC %a26 SPC %a27 SPC %a28 SPC %a29 SPC %a30 SPC %a31 SPC %a32;
- %msg = strreplace(%msg,"_"," ");
- %msg = stripTrailingSpaces(%msg);
- if(%msg $= "")
- {
- messageAll( 'MsgAdminForce', '\c3%1\c6 has been muted by \c3%2\c6 for \c3%3\c6 seconds!', %victim.name, %client.name, %time);
- }
- else
- {
- messageAll( 'MsgAdminForce', '\c3%1\c6 has been muted by \c3%2\c6 for \c3%3\c6 seconds, "\c3%4\c6"', %victim.name, %client.name, %time, %msg);
- }
- $muted[%victim.getBLID()] = true;
- %time *= 1000;
- $time[%victim.getBLID()] = %time;
- $muteSchedule[%victim.getBLID()] = schedule(%time, 0, muteTimeUp, %victim);
- getMutedtime(%victim);
- }
- else
- {
- messageClient(%client,'',"Player not found!");
- }
- }
- else
- {
- messageClient(%client, '',"You do not have permission to use this command!");
- return;
- }
- }
- function getMutedtime(%client)
- {
- if($time[%client.getBLID()] == 0)
- {
- return;
- }
- %bet = 1000;
- $time[%client.getBLID()] -= 1000;
- $muteSch[%client.getBLID()] = schedule(%bet, 0, getMutedtime, %client);
- }
- function muteTimeUp(%client)
- {
- if($left[%client.getBLID()] = true)
- {
- return;
- }
- $muted[%client.getBLID()] = false;
- messageAll( 'MsgAdminForce', '\c3%1\c6 is no longer muted!', %client.name);
- messageClient(%client, '', '\c3Your mute time is up. You can now talk.');
- }
- function GameConnection::onDrop(%client)
- {
- if($muted[%client.getBLID()] = true)
- {
- cancel($muteSchedule[%client.getBLID()]);
- $left[%client.getBLID()] = true;
- }
- parent::onDrop(%client);
- }
- function serverCmdunSilence(%client, %victim)
- {
- if(%client.isAdmin || %client.isSuperAdmin)
- {
- %victim = findClientByName(%victim);
- if(isObject(%victim))
- {
- if(!$silence[%victim.getBLID()] == true)
- {
- messageClient(%client, '', 'This person is not silenced.');
- return;
- }
- $silence[%victim.getBLID()] = false;
- messageAll( 'MsgAdminForce', '\c3%1\c6 has been unsilenced by \c3%2\c6!', %victim.name, %client.name);
- }
- else
- {
- messageClient(%client,'',"Player not found!");
- }
- return;
- }
- messageClient(%client, '', 'You are not an admin!');
- }
- function serverCmdunMute(%client, %victim)
- {
- if(%client.isAdmin || %client.isSuperAdmin)
- {
- %victim = findClientByName(%victim);
- if(isObject(%victim))
- {
- if($muted[%victim.getBLID()] == false)
- {
- messageClient(%client, '', 'This person is not muted.');
- return;
- }
- $muted[%victim.getBLID()] = false;
- messageAll( 'MsgAdminForce', '\c3%1\c6 has been unmuted by \c3%2\c6!', %victim.name, %client.name);
- cancel($muteSchedule[%victim.getBLID()]);
- }
- else
- {
- messageClient(%client,'',"Player not found!");
- }
- return;
- }
- messageClient(%client, '', 'You are not an admin!');
- }
- function serverCmdmessageSent(%client, %text)
- {
- if($silence[%client.getBLID()] == true)
- {
- messageClient(%client, '', '\c6You have been silenced, you cannot talk until you are unsilenced by an administrator.');
- return;
- }
- if($muted[%client.getBLID()] == true)
- {
- $easy[%client.getBLID()] = $time[%client.getBLID()] / 1000;
- if ($easy[%client.getBLID()] == 1)
- {
- %suffix = "";
- }
- else
- {
- %suffix = "s";
- }
- messageClient(%client,'', '\c6You have been muted, you cannot talk for \c3%1\c6 second%2.', $easy[%client.getBLID()], %suffix);
- return;
- }
- parent::serverCmdmessageSent(%client, %text);
- }
- };
- activatePackage(mute);
Advertisement
Add Comment
Please, Sign In to add comment