KAKAN

For Sayian Attack

Sep 18th, 2016
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 1.00 KB | None | 0 0
  1. Mute <- {
  2. IsMuted = array( 100, false );
  3.     function SetMute( playerID, value ){ IsMuted[ playerID ] = value; }
  4.     function GetMute( playerID ){ return IsMuted[ playerID ]; }
  5. }
  6. //Hope so you can understand that part^
  7. function onPlayerCommand( player, cmd, text ){
  8.     if( cmd == "mute" ){
  9.         Mute.SetMute( player.ID, true );
  10.         MessagePlayer("You're muted from the chat now.",player);
  11.     }
  12.     else if( cmd == "unmute" ){
  13.         Mute.SetMute( player.ID, false );
  14.         MessagePlayer("You're unmuted from the chat now.",player);
  15.     }
  16. }
  17.  
  18. function onPlayerChat( player, text ){
  19.     //Check if the player is muted.
  20.     if( Mute.GetMute( player.ID ) ){
  21.         //Yup, he's muted.
  22.         MessagePlayer("You can't do anything while being muted. Use /unmute first.",player);
  23.         //Stop the process here.
  24.         return 0;
  25.     }
  26.     //Do the casual shits here.
  27.     Message( player.Name + " said: " + text );
  28.     //Prevent the default message from getting displayed.
  29.     //I don't think this is necessary, but idk.
  30.     return 0;
  31. }
  32. //http://forum.vc-mp.org/?topic=3730.0
Add Comment
Please, Sign In to add comment