Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <dcmd>
- new bool:Muted[MAX_PLAYERS] = false;
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- dcmd(mute, 4, cmdtext);
- }
- dcmd_mute(playerid, params[])
- {
- new id,string[128];
- if(IsPlayerAdmin(playerid)){
- if(sscanf(params, "i", id)) return SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /mute [playerid]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000AA, "That player isn't connected to the server!");
- if(Muted[id] == false){
- Muted[id] = true;
- SendClientMessage(id, 0xFF0000AA, "You are muted!");
- }
- else{
- Muted[id] = false;
- SendClientMessage(id, 0x00FF00AA, "You are unmuted!");
- }
- }
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(Muted[playerid] == true){
- SendClientMessage(playerid, 0xFF0000AA, "* You are muted! You can't talk!");
- return 0;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement