if(strcmp(cmd, "/prender", true) == 0) {
if(Profissao[playerid] == COP_CIVIL || Profissao[playerid] == F.B.I || Profissao[playerid] == MARINHA || Profissao[playerid] == AERONAUTICA || Profissao[playerid] == EXERCITO || Profissao[playerid] == BOPE || Profissao[playerid] == DELEGADO || Profissao[playerid] == COP_CORRUPTO || Profissao[playerid] == NARCOTICOS || Profissao[playerid] == COP_RODOVIARIO || Profissao[playerid] == COP_ELITE || IsPlayerAdmin(playerid)){
new tmp[256];
new plid;
new distancia;
new string[256];
distancia = GetDistanceBetweenPlayers(playerid, plid);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_RED, "/prender [id]");
return 1;
}
plid = strval(tmp);
if(IsPlayerConnected(plid) && PLAYERLIST_authed[plid] == 1){
if(distancia > 50){
SendClientMessage(playerid, COLOR_RED, "Vocк estб muito longe, chegue mais perto!");
return 1;
}
if(distancia <= 50){
Presos[plid] = 1;
udb_setPrisao(PlayerName(plid), 1);
LogarPlayer(plid);
format(string, sizeof(string), "Vocк foi preso por: %s", PlayerName(playerid));
SendClientMessage(plid, COLOR_SEGURANЗA, string);
SendClientMessage(playerid, COLOR_GREEN, "Prisгo concluнda");
return 1;
}
return 1;
}
else{
SendClientMessage(playerid, COLOR_RED, "Jogador nгo estб conectado/logado");
return 1;
}
}
if(Profissao[playerid] != COP_CIVIL || Profissao[playerid] != COP_RODOVIARIO || Profissao[playerid] != COP_ELITE){
SendClientMessage(playerid, COLOR_RED, "Vocк nгo й policial");
return 1;
}
}
OnPlayerCommandText(...)
{
if (Presos[playerid] == 1)
{
return SendClientMessage(playerid, COR, "Vocк estб preso e nгo pode usar comandos");
}
// resto dos comandos
}
|
Originally Posted by Ritz
Код:
OnPlayerCommandText(...)
{
if (Presos[playerid] == 1)
{
return SendClientMessage(playerid, COR, Vocк estб preso e nгo pode usar comandos)
}
// resto dos comandos
}
|
|
Originally Posted by andmeida10
Quote:
|
|
Originally Posted by Ritz
Quote:
|

if (Presos[playerid] == 1)
{
return SendClientMessage(playerid, COR, "Vocк estб preso e nгo pode usar comandos");
}
OnPlayerCommandText(...)
{
if(strcmp(cmd, "/fianзa", true) == 0)
{
// ...
}
if(strcmp(cmd, "/advogado", true) == 0)
{
// ...
}
if (Presos[playerid] == 1)
{
return SendClientMessage(playerid, COR, Vocк estб preso e nгo pode usar comandos)
}
// resto dos comandos
}
if (Presos[playerid] == 1)
{
return SendClientMessage(playerid, COR, Vocк estб preso e nгo pode usar comandos)
}