[Ajuda] /prender
#1

Achei um bug no meu gm que nг consegui resolver ele simplismente prende todas as pessoas mesmo sem estarem no /procurados oque e meio chato :/ e sei que alguns futuros players iriam abusar tentei o dia todo resolver mas nгo consegui :/


pawn Код:
if(strcmp(cmd, "/prender", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(dini_Int(file, "Profissao") == Policial_C || dini_Int(file, "Profissao") == Policial_F || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == Policial_M || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == LSPD || dini_Int(file, "aAdmin") == 1){
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "(ERRO) Use: /prender [id]");
return 1;
}
plid = strval(tmp);
if(IsPlayerInAnyVehicle(plid) == 1 || IsPlayerInAnyVehicle(playerid) == 1){
SendClientMessage(playerid, Vermelho, "(ERRO) Alguem estб dentro de um carro.");
return 1 ;
}
if(plid == playerid){
SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo pode fazer isto com si mesmo.");
return 1 ;
}
if(!IsPlayerConnected(plid)){
SendClientMessage(playerid, Vermelho, "(ERRO) O jogador nгo estб conectado");
return 1;
} else {
if(GetDistanceBetweenPlayers(plid,playerid) < 10){
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
format(string, sizeof(string), "(INFO) O Policial %s te prendeu.", aname);
SendClientMessage(plid, Blue, string);
SetPlayerPos(plid, 263.8820,77.4002,1001.0391);
SetPlayerInterior(plid, 6);
SetPlayerHealth(plid, 99999);
ResetPlayerWeapons(plid);
dini_IntSet(file2, "Preso", 1);
SendClientMessage(playerid, COLOR_GREEN, "(INFO) Preso com sucesso.");
SetPlayerWantedLevel(plid, 0);
preso[plid] = 1;
TogglePlayerControllable(plid, 1);
if(Procurados[plid] == 1){
GivePlayerGrana(playerid,5000);
Procurados[plid] = 0;
SendClientMessage(playerid, Verde, "(INFO) Vocк prendeu um jogador procurado e ganhou 5 mil!");
dini_IntSet(file2, "Procurado", 0);
}
return 1;
} else {
SendClientMessage(playerid,Vermelho,"(ERRO) Chegue mais perto para prender!");
return 1;
}
}
} else {
SendClientMessage(playerid,Vermelho,"(ERRO) Apenas policiais podem usar este comando!");
return 1;
}
}
Reply
#2

Tenta esse, ai vocк adapta de acordo com seu gm

PHP код:
if(strcmp(cmd"/prender"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
           {
            if(
IsACop(playerid))
            {
                if(
OnDuty[playerid] != 1)
                {
                    
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo Bateu o cartгo!");
                    return 
1;
                }
                if(!
PlayerToPoint(12.0playerid268.3327,77.8972,1001.0391) && !PlayerToPoint(12.0playerid1545.4073,-1607.9791,13.3828) && !PlayerToPoint(12.0playerid324.3141,-1496.9177,24.9219) && !PlayerToPoint(12.0playerid920.5212,-1184.8267,16.9766) &&  !PlayerToPoint(12.0playerid221.1459,115.3492,999.0156) && !PlayerToPoint(12.0playerid193.9101,179.2799,1003.0234) && !PlayerToPoint(12.0playerid1545.7220,-1609.4769,13.3828)
                && !
PlayerToPoint(12.0playerid1019.6051,-317.6436,73.9922) && !PlayerToPoint(12.0playerid195.5733,158.4008,1003.0234)
                && !
PlayerToPoint(12.0playerid, -1298.8188,490.5014,11.1953) && !PlayerToPoint(12.0playerid264.1557,77.5797,1001.0391) && !PlayerToPoint(12.0playerid1361,175.1075,1003.0234) && !PlayerToPoint(12.0playerid321.8284,315.6733,999.1484) && !PlayerToPoint(12.0playerid709.5662,-568.6655,-6.1966) && !PlayerToPoint(3,playerid,852.7875,-1275.1605,14.3879))
                {
// Jail spot
                    
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo estб perto da cela, nгo pode prender o suspeito !");
                    return 
1;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"USE: /prender [id] [tempo (minutos)] [fianca (0=nao 1=sim)] [preco da fianca]");
                    return 
1;
                }
                
giveplayerid ReturnUser(tmp);
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"USE: /prender [id] [tempo (minutos)] [fianca (0=nao 1=sim)] [preco da fianca]");
                    return 
1;
                }
                new 
time strval(tmp);
                if(
time || time 20) { SendClientMessage(playeridCOLOR_GREY"   O Tempo nгo pode ser menor que 1 nem maior que 20 !"); return 1; }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"USE: /prender [id] [tempo (minutos)] [fianca (0=nao 1=sim)] [preco da fianca]");
                    return 
1;
                }
                new 
bail strval(tmp);
                if(
bail || bail 1) { SendClientMessage(playeridCOLOR_GREY"   Fianзa Tem Que ser 0=Nгo ou 1=Sim !"); return 1; }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"USE: /prender [id] [tempo (minutos)] [fianca (0=nao 1=sim)] [preco da fianca]");
                    return 
1;
                }
                new 
bailprice strval(tmp);
                if(
bailprice || bailprice 300000) { SendClientMessage(playeridCOLOR_GREY"   O Preзo nгo pode ser menor que 0 nem maior que R$300000 !"); return 1; }
                new 
suspect giveplayerid;
                if(
IsPlayerConnected(suspect))
                {
                    if(
GetDistanceBetweenPlayers(playerid,suspect) < 15)
                    {
                         if(
PlayerInfo[playerid][pMembro] == || PlayerInfo[playerid][pLider] == 1)
                        {
                            
GetPlayerName(suspectgiveplayersizeof(giveplayer));
                            
GetPlayerName(playeridsendernamesizeof(sendername));
                            if(
WantedPoints[suspect] < 1)
                            {
                                
SendClientMessage(playeridCOLOR_GREY"   O Jogador deve ter no mнnimo 1 nнvel de procurado!");
                                return 
1;
                            }
                            
format(stringsizeof(string), "* Vocк Prendeu %s !"giveplayer);
                            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                            
//GivePlayerMoney(suspect, -moneys);
                            
format(stringsizeof(string), "Preso por %s"PlayerName(playerid));
                            
GameTextForPlayer(suspectstring50005);
                            
ResetPlayerWeaponsEx(suspect);
                            if(
PlayerInfo[playerid][pMembro]==1||PlayerInfo[playerid][pLider]==1)
                            {
                                
format(stringsizeof(string), "<< Policial Militar %s prendeu o suspeito %s >>"sendernamegiveplayer);
                                
OOCNews(COLOR_LIGHTREDstring);
                            }
                            
SetPlayerInterior(suspect6);
                            
SetPlayerPos(suspect,264.6288,77.5742,1001.0391);
                            
PlayerInfo[suspect][pJailTime] = time 60;
                            if(
bail == 1)
                            {
                                
JailPrice[suspect] = bailprice;
                                
format(stringsizeof(string), "Vocк foi preso por %d Segundos.   Fianзa: R$%d"PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
                                
SendClientMessage(suspectCOLOR_LIGHTBLUEstring);
                            }
                            else
                            {
                                
JailPrice[suspect] = 0;
                                
format(stringsizeof(string), "Vocк foi preso por %d Segundos.   Fianзa: Desativada"PlayerInfo[suspect][pJailTime]);
                                
SendClientMessage(suspectCOLOR_LIGHTBLUEstring);
                            }
                            
PlayerInfo[suspect][pJailed] = 1;
                            
SetPlayerFree(suspect,playerid"Foi Preso");
                            
WantedPoints[suspect] = 0;
                            
SetPlayerWantedLevel(suspect0);
                            
WantAdvogado[suspect] = 1;
                            
PlayerInfo[suspect][pMuted] = 0;
                            
Controle(suspect1);
                            
PlayerCuffed[suspect] = 0;
                            
PlayerInfo[suspect][pDrogas] = 0;
                            
PlayerInfo[suspect][pDrogas2] = 0;
                            
PlayerInfo[suspect][pDrogas3] = 0;
                            
PlayerInfo[suspect][pMats] = 0;
                            return 
1;
                        }
                        if(
PlayerInfo[playerid][pMembro] == || PlayerInfo[playerid][pLider] == 2)
                        {
                            
GetPlayerName(suspectgiveplayersizeof(giveplayer));
                            
GetPlayerName(playeridsendernamesizeof(sendername));
                            if(
WantedPoints[suspect] < 1)
                            {
                                
SendClientMessage(playeridCOLOR_GREY"   O Jogador deve ter no minimo 1 nнvel de procura!");
                                return 
1;
                            }
                            
format(stringsizeof(string), "* Vocк Prendeu %s !"giveplayer);
                            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                            
//GivePlayerMoney(suspect, -moneys);
                            
format(stringsizeof(string), "Preso por %s"PlayerName(playerid));
                            
GameTextForPlayer(suspectstring50005);
                            
ResetPlayerWeaponsEx(suspect);
                            if(
PlayerInfo[playerid][pMembro]==2||PlayerInfo[playerid][pLider]==2)
                            {
                                
format(stringsizeof(string), "<< B.O.P.E %s prendeu o suspeito %s >>"sendernamegiveplayer);
                                
OOCNews(COLOR_LIGHTREDstring);
                            }
                            
SetPlayerInterior(suspect10);
                            
SetPlayerPos(suspect,223.5335,110.3779,999.0156);
                            
PlayerInfo[suspect][pJailTime] = time 60;
                            if(
bail == 1)
                            {
                                
JailPrice[suspect] = bailprice;
                                
format(stringsizeof(string), "Vocк foi preso por %d Segundos.   Fianзa: R$%d"PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
                                
SendClientMessage(suspectCOLOR_LIGHTBLUEstring);
                            }
                            else
                            {
                                
JailPrice[suspect] = 0;
                                
format(stringsizeof(string), "Vocк foi preso por %d Segundos.   Fianзa: Desativada"PlayerInfo[suspect][pJailTime]);
                                
SendClientMessage(suspectCOLOR_LIGHTBLUEstring);
                            }
                            
PlayerInfo[suspect][pJailed] = 3;
                            
SetPlayerFree(suspect,playerid"Foi Preso");
                            
WantedPoints[suspect] = 0;
                              
SetPlayerWantedLevel(suspect0);
                            
WantAdvogado[suspect] = 1;
                            
Controle(suspect1);
                            
PlayerInfo[suspect][pMuted] = 0;
                            
PlayerCuffed[suspect] = 0;
                            
PlayerInfo[suspect][pDrogas] = 0;
                            
PlayerInfo[suspect][pDrogas2] = 0;
                            
PlayerInfo[suspect][pDrogas3] = 0;
                            
PlayerInfo[suspect][pMats] = 0;
                            return 
1;
                           }
                        if(
PlayerInfo[playerid][pMembro] == 11 || PlayerInfo[playerid][pLider] == 11)
                        {
                            
GetPlayerName(suspectgiveplayersizeof(giveplayer));
                            
GetPlayerName(playeridsendernamesizeof(sendername));
                            if(
WantedPoints[suspect] < 1)
                            {
                                
SendClientMessage(playeridCOLOR_GREY"   O Jogador deve ter no minimo 1 nнvel de procura!");
                                return 
1;
                            }
                            
format(stringsizeof(string), "* Vocк Prendeu %s !"giveplayer);
                            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                            
//GivePlayerMoney(suspect, -moneys);
                            
format(stringsizeof(string), "Preso por %s"PlayerName(playerid));
                            
GameTextForPlayer(suspectstring50005);
                            
ResetPlayerWeaponsEx(suspect);
                            if(
PlayerInfo[playerid][pMembro]==11||PlayerInfo[playerid][pLider]==11)
                            {
                                
format(stringsizeof(string), "<< Policial Federal %s prendeu o suspeito %s >>"sendernamegiveplayer);
                                
OOCNews(COLOR_LIGHTREDstring);
                            }
                            
SetPlayerInterior(suspect5);
                            
SetPlayerPos(suspect,319.0175,317.0517,999.1484);
                            
PlayerInfo[suspect][pJailTime] = time 60;
                            if(
bail == 1)
                            {
                                
JailPrice[suspect] = bailprice;
                                
format(stringsizeof(string), "Vocк foi preso por %d Segundos.   Fianзa: R$%d"PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
                                
SendClientMessage(suspectCOLOR_LIGHTBLUEstring);
                            }
                            else
                            {
                                
JailPrice[suspect] = 0;
                                
format(stringsizeof(string), "Vocк foi preso por %d Segundos.   Fianзa: Desativada"PlayerInfo[suspect][pJailTime]);
                                
SendClientMessage(suspectCOLOR_LIGHTBLUEstring);
                            }
                            
PlayerInfo[suspect][pJailed] = 5;
                            
SetPlayerFree(suspect,playerid"Foi Preso");
                            
WantedPoints[suspect] = 0;
                            
SetPlayerWantedLevel(suspect0);
                            
WantAdvogado[suspect] = 1;
                            
Controle(suspect1);
                            
PlayerInfo[suspect][pMuted] = 0;
                            
PlayerCuffed[suspect] = 0;
                            
PlayerInfo[suspect][pDrogas] = 0;
                            
PlayerInfo[suspect][pDrogas2] = 0;
                            
PlayerInfo[suspect][pDrogas3] = 0;
                            
PlayerInfo[suspect][pMats] = 0;
                            return 
1;
                          }
                        if(
PlayerInfo[playerid][pMembro] == || PlayerInfo[playerid][pLider] == 3)
                        {
                            
GetPlayerName(suspectgiveplayersizeof(giveplayer));
                            
GetPlayerName(playeridsendernamesizeof(sendername));
                            if(
WantedPoints[suspect] < 1)
                            {
                                
SendClientMessage(playeridCOLOR_GREY"   O Jogador deve ter no minimo 1 nнvel de procura!");
                                return 
1;
                            }
                            
format(stringsizeof(string), "* Vocк Prendeu %s !"giveplayer);
                            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                            
//GivePlayerMoney(suspect, -moneys);
                            
format(stringsizeof(string), "Preso por %s"PlayerName(playerid));
                            
GameTextForPlayer(suspectstring50005);
                            
ResetPlayerWeaponsEx(suspect);
                            if(
PlayerInfo[playerid][pMembro]==3||PlayerInfo[playerid][pLider]==3)
                            {
                                
format(stringsizeof(string), "<< Exйrcito %s prendeu o suspeito %s >>"sendernamegiveplayer);
                                
OOCNews(COLOR_LIGHTREDstring);
                            }
                            
SetPlayerInterior(suspect0);
                            
SetPlayerPos(suspect,-1293.2203,490.5885,11.1953);
                            
PlayerInfo[suspect][pJailTime] = time 60;
                            if(
bail == 1)
                            {
                                
JailPrice[suspect] = bailprice;
                                
format(stringsizeof(string), "Vocк foi preso por %d Segundos.   Fianзa: R$%d"PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
                                
SendClientMessage(suspectCOLOR_LIGHTBLUEstring);
                            }
                            else
                            {
                                
JailPrice[suspect] = 0;
                                
format(stringsizeof(string), "Vocк foi preso por %d Segundos.   Fianзa: Desativada"PlayerInfo[suspect][pJailTime]);
                                
SendClientMessage(suspectCOLOR_LIGHTBLUEstring);
                            }
                            
PlayerInfo[suspect][pJailed] = 7;
                            
SetPlayerFree(suspect,playerid"Foi Preso");
                            
WantedPoints[suspect] = 0;
                            
SetPlayerWantedLevel(suspect0);
                            
WantAdvogado[suspect] = 1;
                            
Controle(suspect1);
                            
PlayerInfo[suspect][pMuted] = 0;
                            
PlayerCuffed[suspect] = 0;
                            
PlayerInfo[suspect][pDrogas] = 0;
                            
PlayerInfo[suspect][pDrogas2] = 0;
                            
PlayerInfo[suspect][pDrogas3] = 0;
                            
PlayerInfo[suspect][pMats] = 0;
                            return 
1;
                        }
                        if(
PlayerInfo[playerid][pMembro] == 16 || PlayerInfo[playerid][pLider] == 16)
                        {
                            
GetPlayerName(suspectgiveplayersizeof(giveplayer));
                            
GetPlayerName(playeridsendernamesizeof(sendername));
                            if(
WantedPoints[suspect] < 1)
                            {
                                
SendClientMessage(playeridCOLOR_GREY"   O Jogador deve ter no minimo 1 nнvel de procura!");
                                return 
1;
                            }
                            
format(stringsizeof(string), "* Vocк Prendeu %s !"giveplayer);
                            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                            
//GivePlayerMoney(suspect, -moneys);
                            
format(stringsizeof(string), "Preso por %s"PlayerName(playerid));
                            
GameTextForPlayer(suspectstring50005);
                            
ResetPlayerWeaponsEx(suspect);
                            if(
PlayerInfo[playerid][pMembro]==16||PlayerInfo[playerid][pLider]==16)
                            {
                                
format(stringsizeof(string), "<< Policial Civil %s prendeu o suspeito %s >>"sendernamegiveplayer);
                                
OOCNews(COLOR_LIGHTREDstring);
                            }
                            
SetPlayerInterior(suspect3);
                            
SetPlayerPos(suspect,198.1076,175.0731,1003.0234);
                            
PlayerInfo[suspect][pJailTime] = time 60;
                            if(
bail == 1)
                            {
                                
JailPrice[suspect] = bailprice;
                                
format(stringsizeof(string), "Vocк foi preso por %d Segundos.   Fianзa: R$%d"PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
                                
SendClientMessage(suspectCOLOR_LIGHTBLUEstring);
                            }
                            else
                            {
                                
JailPrice[suspect] = 0;
                                
format(stringsizeof(string), "Vocк foi preso por %d Segundos.   Fianзa: Desativada"PlayerInfo[suspect][pJailTime]);
                                
SendClientMessage(suspectCOLOR_LIGHTBLUEstring);
                            }
                            
PlayerInfo[suspect][pJailed] = 4;
                            
SetPlayerFree(suspect,playerid"Foi Preso");
                            
WantedPoints[suspect] = 0;
                            
SetPlayerWantedLevel(suspect0);
                            
Controle(suspect1);
                            
PlayerInfo[suspect][pMuted] = 0;
                            
PlayerCuffed[suspect] = 0;
                            
WantAdvogado[suspect] = 1;
                            
PlayerInfo[suspect][pDrogas] = 0;
                            
PlayerInfo[suspect][pDrogas2] = 0;
                            
PlayerInfo[suspect][pDrogas3] = 0;
                            
PlayerInfo[suspect][pMats] = 0;
                            return 
1;
                        }
                        if(
PlayerInfo[playerid][pMembro] == 24 || PlayerInfo[playerid][pLider] == 24)
                        {
                            
GetPlayerName(suspectgiveplayersizeof(giveplayer));
                            
GetPlayerName(playeridsendernamesizeof(sendername));
                            if(
WantedPoints[suspect] < 1)
                            {
                                
SendClientMessage(playeridCOLOR_GREY"   O Jogador deve ter no minimo 1 nнvel de procura!");
                                return 
1;
                            }
                            
format(stringsizeof(string), "* Vocк Prendeu %s !"giveplayer);
                            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                            
//GivePlayerMoney(suspect, -moneys);
                            
format(stringsizeof(string), "Preso por %s"PlayerName(playerid));
                            
GameTextForPlayer(suspectstring50005);
                            
ResetPlayerWeaponsEx(suspect);
                            if(
PlayerInfo[playerid][pMembro]==24||PlayerInfo[playerid][pLider]==24)
                            {
                                
format(stringsizeof(string), "<< Policial Rodoviario Federal %s prendeu o suspeito %s >>"sendernamegiveplayer);
                                
OOCNews(COLOR_LIGHTREDstring);
                            }
                            
SetPlayerInterior(suspect6);
                            
SetPlayerPos(suspect,264.6288,77.5742,1001.0391);
                            
PlayerInfo[suspect][pJailTime] = time 60;
                            if(
bail == 1)
                            {
                                
JailPrice[suspect] = bailprice;
                                
format(stringsizeof(string), "Vocк foi preso por %d Segundos.   Fianзa: R$%d"PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
                                
SendClientMessage(suspectCOLOR_LIGHTBLUEstring);
                            }
                            else
                            {
                                
JailPrice[suspect] = 0;
                                
format(stringsizeof(string), "Vocк foi preso por %d Segundos.   Fianзa: Desativada"PlayerInfo[suspect][pJailTime]);
                                
SendClientMessage(suspectCOLOR_LIGHTBLUEstring);
                            }
                            
PlayerInfo[suspect][pJailed] = 1;
                            
SetPlayerFree(suspect,playerid"Foi Preso");
                            
WantedPoints[suspect] = 0;
                            
SetPlayerWantedLevel(suspect0);
                            
WantAdvogado[suspect] = 1;
                            
Controle(suspect1);
                            
PlayerInfo[suspect][pMuted] = 0;
                            
PlayerCuffed[suspect] = 0;
                            
PlayerInfo[suspect][pDrogas] = 0;
                            
PlayerInfo[suspect][pDrogas2] = 0;
                            
PlayerInfo[suspect][pDrogas3] = 0;
                            
PlayerInfo[suspect][pMats] = 0;
                            return 
1;
                          }
                    }
//distance
                
}//not connected
                
else
                {
                    
SendClientMessage(playeridCOLOR_GREY"   Esse nгo й um jogador ativo.");
                    return 
1;
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo й um Oficial !");
                return 
1;
            }
        }
//not connected
        
return 1;
    } 
Reply
#3

man teu code e muito dificil de aplicar no meu gm :S "uso gm de base BTG"
Reply
#4

pawn Код:
if (strcmp(cmd, "/prender", true) == 0)
{
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    if (dini_Int(file, "Profissao") == Policial_C || dini_Int(file, "Profissao") == Policial_F || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == Policial_M || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == LSPD || dini_Int(file, "aAdmin") == 1)
    {
        new tmp[256];
        new plid;
        if (IsPlayerInAnyVehicle(plid) == 1 && IsPlayerInAnyVehicle(playerid) == 1) return SendClientMessage(playerid, Vermelho, "(ERRO) Alguem estб dentro de um carro.");
        if (plid == playerid) return SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo pode fazer isto com si mesmo.");
        tmp = strtok(cmdtext, idx);
        if (!strlen(tmp)) return SendClientMessage(playerid, Vermelho, "(ERRO) Use: /prender [id]");
        plid = strval(tmp);
        if (!IsPlayerConnected(plid)) return SendClientMessage(playerid, Vermelho, "(ERRO) O jogador nгo estб conectado");
        if (GetDistanceBetweenPlayers(plid, playerid) < 10) return SendClientMessage(playerid, Vermelho, "(ERRO) Chegue mais perto para prender!");
        if (GetPlayerWantedLevel < 0) return SendClientMessage(playerid, Vermelho, " Este jogador nгo estб preparado!");
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(plid, pname, MAX_PLAYER_NAME);
        format(string, sizeof(string), "(INFO) O Policial %s te prendeu.", aname);
        SendClientMessage(plid, Blue, string);
        SetPlayerPos(plid, 263.8820, 77.4002, 1001.0391);
        SetPlayerInterior(plid, 6);
        SetPlayerHealth(plid, 99999);
        ResetPlayerWeapons(plid);
        dini_IntSet(file2, "Preso", 1);
        SendClientMessage(playerid, COLOR_GREEN, "(INFO) Preso com sucesso.");
        SetPlayerWantedLevel(plid, 0);
        preso[plid] = 1;
        TogglePlayerControllable(plid, 1);
        if (Procurados[plid] == 1)
        {
            GivePlayerGrana(playerid, 5000);
            Procurados[plid] = 0;
            dini_IntSet(file2, "Procurado", 0);
            SendClientMessage(playerid, Verde, "(INFO) Vocк prendeu um jogador procurado e ganhou 5 mil!");
        }
        else
    }
    SendClientMessage(playerid, Vermelho, "(ERRO) Apenas policiais podem usar este comando!");
}
return 1;
}
Reply
#5

ainda nada ...
Reply
#6

Toma aki charб, se der certo clica na estrelinha embaixo do meu nome? Vlw:

pawn Код:
if(strcmp(cmd, "/prender", true) == 0)
{
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), P_CONTAS, aname);

    if(dini_Int(file, "Profissao") == Policial_C || dini_Int(file, "Profissao") == Policial_F || dini_Int(file, "Profissao") == Recruta || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Rotam || dini_Int(file, "Profissao") == Policial_M || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "pAdm01") == 1)
    {
        new tmp[256];

        new plid;
        tmp = strtok(cmdtext, idx);

        if(!strlen(tmp))
        {
        SendClientMessage(playerid, Vermelho, "{0099FF}[x]{CCCCFF} Use: /prender [id] [motivo]");
        return 1;
        }

        plid = strval(tmp);
        if(GetPlayerWantedLevel(plid) == 0)
        {
                 return SendClientMessage(playerid, -1, "{2F7AFC} Esse jogador nгo estб sendo procurado, portanto nгo poderб ser preso!");
        }
        if(IsPlayerInAnyVehicle(plid) == 1 || IsPlayerInAnyVehicle(playerid) == 1)
        {
            SendClientMessage(playerid, Vermelho, "{0099FF}[x]{CCCCFF} O Player estб dentro de um carro e nгo pode ser preso.");
            return 1 ;
        }

        if(plid == playerid)
        {
            SendClientMessage(playerid, Vermelho, "{0099FF}[x]{CCCCFF} Vocк nгo pode fazer isto com si mesmo.");
            return 1 ;
        }
        if(!IsPlayerConnected(plid))
        {
            SendClientMessage(playerid, Vermelho, "{0099FF}[x]{CCCCFF} O jogador nгo estб conectado");
            return 1;
        }
        else
        {
            if(GetDistanceBetweenPlayers(plid,playerid) < 10)
            {

                //AQUI VAI LER O MOTIVO
                new length = strlen(cmdtext);
                while ((idx < length) && (cmdtext[idx] <= ' '))
                {
                    idx++;
                }
                new offset = idx;
                new result[100];
                while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                {
                    result[idx - offset] = cmdtext[idx];
                    idx++;
                }
                result[idx - offset] = EOS;
                //--------------------------------------------

                new pname[MAX_PLAYER_NAME];
                GetPlayerName(plid, pname, MAX_PLAYER_NAME);
                format(file2, sizeof(file2), P_CONTAS, pname);
                format(string, sizeof(string), "[x] O policial %s te prendeu.", aname);
                SendClientMessage(plid, AzuL4, string);
                SetPlayerPos(plid, 263.8820,77.4002,1001.0391);
                SetPlayerInterior(plid, 6);
                SetPlayerHealth(plid, 99999);
                ResetPlayerWeapons(plid);
                dini_IntSet(file2, "Preso", 1);
                SendClientMessage(playerid, COLOR_GREEN, "{0099FF}[x]{CCCCFF} Preso com sucesso.");
                SetPlayerWantedLevel(plid, 0);
                preso[plid] = 1;
                TogglePlayerControllable(plid, 1);

                //MENSAGEM PARA TODOS
                format(string, sizeof(string), "{2F7AFC} | PRISГO | O policial %s prendeu o procurado %s pelo motivo: %s!", aname, pname, (result));
                SendClientMessageToAll(-1 ,string);

                if(Procurados[plid] == 1)
                {
                    GivePlayerGrana(playerid,60);
                    Procurados[plid] = 0;
                    SendClientMessage(playerid, Verde, "{0099FF}[x]{CCCCFF} Vocк ganhou uns trocados por ter prendido um procurado!");
                    dini_IntSet(file2, "Procurado", 0);
                }
                return 1;
            }
            else
            {
                SendClientMessage(playerid,Vermelho,"{0099FF}[x]{CCCCFF} Chegue mais perto para prender!");
                return 1;
            }
        }
    }
    else
    {
        SendClientMessage(playerid,Vermelho,"{0099FF}[x]{CCCCFF} Apenas policiais podem usar este comando!");
        return 1;
    }
}
Reply
#7

muito obrigado mas eu jб tinha resolvido >,<'
E o seu nгo ia se encaixar muito bem no meu gamemode :S
Mesmo assim vlw
Reply
#8

Quote:
Originally Posted by ShutDown_
Посмотреть сообщение
muito obrigado mas eu jб tinha resolvido >,<'
E o seu nгo ia se encaixar muito bem no meu gamemode :S
Mesmo assim vlw
Meu gamemode tambйm estб com esse problema de prender quem nгo estб procurado, to tentando arrumar faz 3 dias, pode me dizer oque vocк fez para arrumar ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)