new Bloqueado;
//Uma base
if (strcmp("/relatorio", cmdtext, true, 10) == 0)
{
if(Bloqueado = 1)
{
SendClientMessage(playerid,-1,"O /relatorio estб bloqueado!");
return 1;
}
else
{
//Caso nгo esteja, agora sу cria o /relatorio normalmente
return 1;
}
return 1;
}
if (strcmp("/bloqrelato", cmdtext, true, 10) == 0)
{
if(IsPlayerAdmin(playerid)) //Deve ser adm rcon, troque pela variavel de adm
{
if(Bloqueado = 1)
{
SendClientMessage(playerid,-1,"O /relatorio jб estб bloqueado");
return 1;
}
else
{
Bloqueado = 1;
SendClientMessageToAll(-1,"O /relatorio foi bloqueado por um Admin");
return 1;
}
return 1;
}
return 1;
}
|
Cara nгo sei se й isso + vc quer que quando esse cmd esteja ativado ninguйm consegue da /relato? Se for basta criar uma variavel
PHP код:
PHP код:
|
if(Bloqueado = 1)
if(Bloqueado == 1)
new bool:BlockRelatorio;
command(relatorio, playerid, params[])
{
if(BlockRelatorio) /* true */return SendClientMessage(playerid, -1, "Relatуrios bloqueado.");
//restante do cуdigo
return 1;
}
command(blockrelatorio, playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
if(!BlockRelatorio) //false
{
BlockRelatorio = true; //coloca true
SendClientMessage(playerid, -1, "Relatуrio bloqueado!");
}
else //true
{
BlockRelatorio = false; //coloca false
SendClientMessage(playerid, -1, "Relatуrio desbloqueado.");
}
}
return 1;
}
/*
explicaзгo:
!BlockRelatorio = BlockRelatorio - false
BlockRelatorio = BlockRelatorio - true
*/
CMD:relatorio(playerid, params[])
{
if(BlockRelatorio) return SendClientMessage(playerid, -1, "Relatуrios bloqueado.");
if(isnull(params)) return SendClientMessage(playerid, 0xFF0000AA, "Use: /relatorio [texto]");
new string[144], name[24];
GetPlayerName(playerid, name, 24);
format(string, 144, "Relatуrio de %s: %s", name, params);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(variavel admin)
{
if(!GetPVarInt(i, "BlockRelatorio"))
{
SendClientMessage(i, -1, string);
}
}
}
}
return 1;
}
CMD:blockrelatorio(playerid, params[])
{
if(variavel admin)
{
if(!GetPVarInt(playerid, "BlockRelatorio")) //false
{
SetPVarInt(playerid, "BlockRelatorio", 1);
SendClientMessage(playerid, -1, "Relatуrio bloqueado!");
}
else
{
DeletePVar(playerid, "BlockRelatorio");
SendClientMessage(playerid, -1, "Relatуrio desbloqueado.");
}
}
return 1;
}