} if (strcmp(cmd,"/retirarbloqueios",true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] < 1337) { SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo estб autorizado a usar este comando !"); return 1; } if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342 && PlayerInfo[playerid][pAdmin] != 1341) { SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)"); return 1; } for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { RemoveGangue(i); RemoveBloqueio(i); RemoveBarreira(i); RemoveRoadPregos(i); RemoveParedao(i); RemoveBarraca(i); GetPlayerName(i,playername,sizeof(playername)); format(string,sizeof(string),"AdmCmd: %s Retirou todos bloqueios existentes!",PlayerName(playerid)); SendClientMessageToAll(COLOR_LIGHTRED,string); } } } return 1; }
if (strcmp(cmd,"/retirarbloqueios",true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 1337)
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo estб autorizado a usar este comando !");
return 1;
}
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342 && PlayerInfo[playerid][pAdmin] != 1341)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
return 1;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
RemoveGangue(i);
RemoveBloqueio(i);
RemoveBarreira(i);
RemoveRoadPregos(i);
RemoveParedao(i);
RemoveBarraca(i);
GetPlayerName(i,playername,sizeof(playername));
format(string,sizeof(string),"AdmCmd: %s Retirou todos bloqueios existentes!",PlayerName(playerid));
SendClientMessage(i,COLOR_LIGHTRED,string);
}
}
}
return 1;
}
pawn Код:
|
if (strcmp(cmd,"/retirarbloqueios",true) == 0)
{
if(!IsPlayerConnected(playerid)) return 1;
if(PlayerInfo[playerid][pAdmin] < 1337)
return SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo estб autorizado a usar este comando !");
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342 && PlayerInfo[playerid][pAdmin] != 1341)
return SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
for(new a = 0, b = GetMaxPlayers(); a < b; ++a)
{
if(IsPlayerConnected(i)) {
RemoveGangue(i);
RemoveBloqueio(i);
RemoveBarreira(i);
RemoveRoadPregos(i);
RemoveParedao(i);
RemoveBarraca(i);
}
}
GetPlayerName(i,playername,sizeof(playername));
format(string,sizeof(string),"AdmCmd: %s retirou todos bloqueios existentes!",PlayerName(playerid));
SendClientMessageToAll(COLOR_LIGHTRED,string);
}
return 1;
}
Isso nгo vai funcionar. Vai repetir 500 vezes.
@Ween Apenas retire o SendClientMessageToAll do loop e terб o resultado que quer. |