Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Mute <- {
- IsMuted = array( 100, false );
- function SetMute( playerID, value ){ IsMuted[ playerID ] = value; }
- function GetMute( playerID ){ return IsMuted[ playerID ]; }
- }
- //Hope so you can understand that part^
- function onPlayerCommand( player, cmd, text ){
- if( cmd == "mute" ){
- Mute.SetMute( player.ID, true );
- MessagePlayer("You're muted from the chat now.",player);
- }
- else if( cmd == "unmute" ){
- Mute.SetMute( player.ID, false );
- MessagePlayer("You're unmuted from the chat now.",player);
- }
- }
- function onPlayerChat( player, text ){
- //Check if the player is muted.
- if( Mute.GetMute( player.ID ) ){
- //Yup, he's muted.
- MessagePlayer("You can't do anything while being muted. Use /unmute first.",player);
- //Stop the process here.
- return 0;
- }
- //Do the casual shits here.
- Message( player.Name + " said: " + text );
- //Prevent the default message from getting displayed.
- //I don't think this is necessary, but idk.
- return 0;
- }
- //http://forum.vc-mp.org/?topic=3730.0
Add Comment
Please, Sign In to add comment