31.08.2009, 23:51
Here is mute and unmute, it should work, although it is untested
Mute
Unmute
Mute
Код:
new Muted[MAX_PLAYERS]; public OnPlayerText(playerid, text[]) { if(Muted[playerid]==1) { SendClientMessage(playerid, 0xAA333300, "You are muted"); return 0; } } public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmd, "/mute", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, 0xAA333300, "USAGE: /mute [playerid]"); return 1; } if (!IsPlayerConnected(tmp)) { new name[MAX_PLAYER_NAME], tmp2[128]; Muted[tmp]=1; GetPlayerName(tmp,name,sizeof(name)); format(tmp2,sizeof(tmp2),"Muted %s [ID:%i]",name,tmp); SendClientMessage(playerid, 0xAA333300, tmp2); return 1; } } } public OnPlayerDisconnect(playerid, reason) { Muted[playerid]=0; }
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmd, "/unmute", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, 0xAA333300, "USAGE: /unmute [playerid]"); return 1; } if (!IsPlayerConnected(tmp)) { new name[MAX_PLAYER_NAME], tmp2[128]; Muted[tmp]=1; GetPlayerName(tmp,name,sizeof(name)); format(tmp2,sizeof(tmp2),"Unmuted %s [ID:%i]",name,tmp); SendClientMessage(playerid, 0x33AA3300, tmp2); return 1; } } }