[Ajuda] Comando /prender
#1

PHP код:
if(strcmp(cmd"/prender"true) == 0) {
new 
aname[MAX_PLAYER_NAME];
GetPlayerName(playeridanameMAX_PLAYER_NAME);
format(filesizeof(file), PASTA_CONTASaname);
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(cmdtextidx);
if(!
strlen(tmp)){
SendClientMessage(playeridVermelho"(ERRO) Use: /prender [id]");
return 
1;
}
plid strval(tmp);
if(
IsPlayerInAnyVehicle(plid) == || IsPlayerInAnyVehicle(playerid) == 1){
SendClientMessage(playeridVermelho"(ERRO) Alguem estб dentro de um carro.");
return 
;
}
if(
plid == playerid){
SendClientMessage(playeridVermelho"(ERRO) Vocк nгo pode fazer isto com si mesmo.");
return 
;
}
if(!
IsPlayerConnected(plid)){
SendClientMessage(playeridVermelho"(ERRO) O jogador nгo estб conectado");
return 
1;
} else {
if(
GetDistanceBetweenPlayers(plid,playerid) < 10){
new 
pname[MAX_PLAYER_NAME];
GetPlayerName(plidpnameMAX_PLAYER_NAME);
format(file2sizeof(file2), PASTA_CONTASpname);
format(stringsizeof(string), "(INFO) O Policial %s te prendeu."aname);
SendClientMessage(plidBluestring);
SetPlayerPos(plid263.8820,77.4002,1001.0391);
SetPlayerInterior(plid6);
SetPlayerHealth(plid99999);
ResetPlayerWeapons(plid);
dini_IntSet(file2"Preso"1);
SendClientMessage(playeridCOLOR_GREEN"(INFO) Preso com sucesso.");
SetPlayerWantedLevel(plid0);
preso[plid] = 1;
TogglePlayerControllable(plid1);
if(
Procurados[plid] == 1){
GivePlayerGrana(playerid,90000);
Procurados[plid] = 0;
SendClientMessage(playeridVerde"(INFO) Vocк prendeu um jogador procurado e ganhou 90 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;
}

Entгo galera gostaria de saber como posso por pra quando um player nгo estiver procurado, nгo ser preso se usarem o /prender nele ..

Ajudem plz
Reply
#2

pawn Код:
if ( GetPlayerWantedLevel ( plid ) == 0 )
    return SendClientMessage ( playerid, Vermelho, "(ERRO) Esse jogador nгo estб procurado!" ) ;
Reply
#3

Obrigado los, Gostaria que adicionasse meu Skype, dean.santos5
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)