COMMAND:calar(playerid, params[])
{
new Msg[128], Name[24], AdminName[24], Reason[128], OtherPlayer;
SendAdminText(playerid, "/calar", params);
if (APlayerData[playerid][LoggedIn] == true)
{
if (APlayerData[playerid][PlayerLevel] >= 1)
{
if (sscanf(params, "us[128]", OtherPlayer, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Use: /calar [id] [motivo]");
else
{
if (IsPlayerConnected(OtherPlayer))
{
GetPlayerName(playerid, AdminName, sizeof(AdminName));
GetPlayerName(OtherPlayer, Name, sizeof(Name));
APlayerData[OtherPlayer][Muted] = true;
format(Msg, 128, "{FF0000}-| %s foi calado por %s. Motivo: %s |-", Name, AdminName, Reason);
SendClientMessageToAll(0xFFFFFFFF, Msg);
PlayerFile_Save(OtherPlayer);
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}O jogador nгo estб online.");
}
}
else
return 0;
}
else
return 0;
return 1;
}
COMMAND:descalar(playerid, params[])
{
new Msg[128], Name[24], AdminName[24], OtherPlayer;
SendAdminText(playerid, "/descalar", params);
if (APlayerData[playerid][LoggedIn] == true)
{
if (APlayerData[playerid][PlayerLevel] >= 1)
{
if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Use: /descalar [id]");
else
{
if (IsPlayerConnected(OtherPlayer))
{
GetPlayerName(playerid, AdminName, sizeof(AdminName));
GetPlayerName(OtherPlayer, Name, sizeof(Name));
APlayerData[OtherPlayer][Muted] = false;
format(Msg, 128, "{FF0000}-| O Administrador %s permitiu que %s volte a falar |-", AdminName, Name);
SendClientMessageToAll(0xFFFFFFFF, Msg);
PlayerFile_Save(OtherPlayer);
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}O jogador nao esta online.");
}
}
else
return 0;
}
else
return 0;
return 1;
}
CMD:calar(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /calar [id]");
return 1;
}
new giveplayer[MAX_PLAYER_NAME];
new sendername[MAX_PLAYER_NAME];
new playa;
playa = ReturnUser(tmp);
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if(admtrampando[playerid] >= 1)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
return 1;
}
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playa][pMuted] == 0)
{
PlayerInfo[playa][pMuted] = 1;
format(string, sizeof(string), "AdminCmd: %s Foi calado por %s",giveplayer ,sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
}
else
{
PlayerInfo[playa][pMuted] = 0;
format(string, sizeof(string), "%s Foi descalado por %s",giveplayer ,sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo esta autorizado a usar este comando!");
}
}
return 1;
}
public OnPlayerText(playerid, text[])
{
if(APlayerData[playerid][Muted] == true)return SendClientMessage(playerid, GetPlayerColor(playerid), "[ERRO]Vocк esta calado!");
return 0;
}
/ Block the player's text if he has been muted
if (APlayerData[playerid][Muted] == true)
{
// Let the player know he's still muted
SendClientMessage(playerid, 0xFFFFFFFF, "{808080}Voce estб Mudo Agora.");
// Don't allow his text to be sent to the chatbox
return 0;
}
return 1;
}
new Calado[MAX_PLAYERS] = 0; // topo do GM
OnPLayerConnect
Calado[playerid] = 0; // iremos iniciar o o calado com 0 dai quando ele conectar ele n fica mudo
if(Calado[playerid] == 1)
{
SendClientMessage(playerid, Amarelo, "| ERRO | Vocк estб calado e nгo pode falar!");
return 0;
}
COMMAND:calar(playerid, params[])
{
new Msg[128], Name[24], AdminName[24], Reason[128], OtherPlayer;
SendAdminText(playerid, "/calar", params);
if (APlayerData[playerid][LoggedIn] == true)
{
if (APlayerData[playerid][PlayerLevel] >= 1)
{
if (sscanf(params, "us[128]", OtherPlayer, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Use: /calar [id] [motivo]");
else
{
if (IsPlayerConnected(OtherPlayer))
{
GetPlayerName(playerid, AdminName, sizeof(AdminName));
GetPlayerName(OtherPlayer, Name, sizeof(Name));
APlayerData[OtherPlayer][Muted] = true;
Calado[playerid] = 1;
format(Msg, 128, "{FF0000}-| %s foi calado por %s. Motivo: %s |-", Name, AdminName, Reason);
SendClientMessageToAll(0xFFFFFFFF, Msg);
PlayerFile_Save(OtherPlayer);
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}O jogador nгo estб online.");
}
}
else
return 0;
}
else
return 0;
return 1;
}
COMMAND:descalar(playerid, params[])
{
new Msg[128], Name[24], AdminName[24], OtherPlayer;
SendAdminText(playerid, "/descalar", params);
if (APlayerData[playerid][LoggedIn] == true)
{
if (APlayerData[playerid][PlayerLevel] >= 1)
{
if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Use: /descalar [id]");
else
{
if (IsPlayerConnected(OtherPlayer))
{
GetPlayerName(playerid, AdminName, sizeof(AdminName));
GetPlayerName(OtherPlayer, Name, sizeof(Name));
APlayerData[OtherPlayer][Muted] = false;
Calado[playerid] = 0;
format(Msg, 128, "{FF0000}-| O Administrador %s permitiu que %s volte a falar |-", AdminName, Name);
SendClientMessageToAll(0xFFFFFFFF, Msg);
PlayerFile_Save(OtherPlayer);
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}O jogador nao esta online.");
}
}
else
return 0;
}
else
return 0;
return 1;
}
pawn Код:
|
public OnPlayerText(playerid, text[])
{
if(APlayerData[playerid][Muted] == true)
{
SendClientMessage(playerid, 0xFF0000AA, "Foste calado e nгo podes falar!");
return 1;
}
return 0;
}