enum pInfo
{
Chat,
}
public OnPlayerConnect(playerid)
{
PlayerInfo[playerid][Chat] = 0;
}
public OnPlayerDisconnect(playerid, reason)
{
PlayerInfo[playerid][Chat] = 0;
}
// OnPlayerText Completo, Pois Acho que o Erro encontra-se aqui
public OnPlayerText(playerid, text[])
{
if(PlayerInfo[playerid][Chat] == 1 && PlayerInfo[playerid][pAdmin] <= 1000)
{
SendClientMessage(playerid, VERMELHO_ESCURO, "[x] O chat foi desativado por um Administrador!");
}
new StringTexto[228];
GetPlayerName(playerid, pNome, sizeof(pNome));
for(new i; i != GetMaxPlayers(); i++)
{
if(PlayerInfo[playerid][pAdmin] == 2000)
{
format(StringTexto, sizeof(StringTexto), "® %s [%d]: {FFFFFF}%s", pNome, playerid, text);
SendClientMessage(i, GetPlayerColor(playerid), StringTexto);
}
else if(PlayerInfo[playerid][pAdmin] == 1000)
{
format(StringTexto, sizeof(StringTexto), "© %s [%d]: {FFFFFF}%s ", pNome, playerid, text);
SendClientMessage(i, GetPlayerColor(playerid), StringTexto);
}
if(PlayerInfo[playerid][pAdmin] == 0)
{
format(StringTexto, sizeof(StringTexto), "• %s [%d]: {FFFFFF}%s", pNome, playerid, text);
SendClientMessage(i, GetPlayerColor(playerid), StringTexto);
}
}
AdminColor(playerid);
return 0;
}
// CMD DO CHAT
CMD:chaton(playerid, params[])
{
new TextoChat[256], name[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][pAdmin] < 1000)
{
SendClientMessage(playerid, VERMELHO_ESCURO,"[x] Vocк Nao Tem Permissao!");
return 1;
}
if(PlayerInfo[playerid][pAdmin] > 2000)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerName(playerid, name, sizeof(name));
format(TextoChat, sizeof(TextoChat), "[ BCV ] O Administrador %s Ativou o Chat.", name);
SendClientMessageToAll(0x00FF40AA, TextoChat);
PlayerInfo[i][Chat] = 0;
}
}
}
return 1;
}
CMD:chatoff(playerid, params[])
{
new TextoChat[256], name[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][pAdmin] < 2000)
{
SendClientMessage(playerid, VERMELHO_ESCURO,"[x] Vocк Nao Tem Permissao!");
return 1;
}
if(PlayerInfo[playerid][pAdmin] >= 2000)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerName(playerid, name, sizeof(name));
format(TextoChat, sizeof(TextoChat), "[ BCV ] O Administrador %s Desativou o Chat.", name);
SendClientMessageToAll(VERMELHO_ESCURO, TextoChat);
PlayerInfo[i][Chat] = 1;
}
}
}
return 1;
}
// Topo do GM
new bool:Bloqueado;
// COMANDO PARA BLOEUEAR
Bloqueado = true;
// Comando para desbloquear
Bloqueado = false;
// public OnPlayerText
if(Bloqueado) return false;
new BloquearChat[MAX_PLAYERS];
public OnPlayerText(playerid, text[])
{
if(BloquearChat[playerid] == 1)
{
SendClientMessage(playerid, -1, "Chat Bloqueado, Vocк nгo Pode Digitar.");
return 0;
}
return 1;
}
CMD:bloquearchat(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
BloquearChat[i] = 1;
}
return 1;
}
CMD:desbloquearchat(playerid)
{
for(new d = 0; d < MAX_PLAYERS; d++)
{
BloquearChat[d] = 0;
}
return 1;
}
|
pawn Код:
|
new BloquearChat[MAX_PLAYERS];
public OnPlayerText(playerid, text[])
{
if(BloquearChat[playerid] == 1) return SendClientMessage(playerid, -1, "Chat Bloqueado, Vocк nгo Pode Digitar.");
return 1;
}
CMD:bloquearchat(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++){BloquearChat[i] = 1;}
return 1;
}
CMD:desbloquearchat(playerid)
{
for(new d = 0; d < MAX_PLAYERS; d++){BloquearChat[d] = 0;}
return 1;
}
|
pawn Код:
|