[Ajuda] /algemar bugado & Quem morre fica na lista de procurados
#1

Gente quando alguйm algema o outro player da para o player usar comando, eu queria que nгo desse por exemplo, eu vou algemo um player, ele usa /afk e depois /on ai fica desalgemado, e tambйm quando eu mato alguйm o player que eu matei fica na lista de procurados


New
pawn Код:
new algemado[MAX_PLAYERS]= 0;
Variavel
pawn Код:
algemado[playerid] = 0;
Comando /fianca
pawn Код:
if(strcmp(cmdtext, "/fianca", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
new grana;
grana = dini_Int(file, "SaldoBancario");
if(dini_Int(file, "Preso") == 1){
if(grana > 10000){
if(Preso[playerid]>= 2){
SetPlayerWantedLevel(playerid, 0);
Procurados[playerid] = 0;
dini_IntSet(file2, "Procurado", 0);
dini_IntSet(file, "Preso",0);
dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")-Fianca);
preso[playerid] = 0;
Preso[playerid] = 0;
algemado[playerid] = 0;
SpawnPlayer(playerid);
SetPlayerHealth(playerid,100);
SendClientMessage(playerid, Verde,"(INFO) Vocк pagou a fianзa e foi solto!.");
} else {
SendClientMessage(playerid, Vermelho,"(ERRO) Vocк tem que esperar 2 minutos para poder pagar a fianзa!");
}
} else {
SendClientMessage(playerid, Vermelho,"(ERRO) Vocк nгo possui dinheiro suficiente! (R$10.000)");
}
} else {
SendClientMessage(playerid, Vermelho,"(ERRO) Vocк nгo estб preso!");
}
return 1;
}
Meio do GM
pawn Код:
algemado[plid]= 0;
Comando /soltar
pawn Код:
if(strcmp(cmd, "/soltar", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(dini_Int(file, "aAdmin") == 1 || dini_Int(file, "Profissao") == Advogado || dini_Int(file, "Profissao") == Presidente || dini_Int(file, "Profissao") == Prefeito || IsPlayerAdmin(playerid)){
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "(ERRO) Use: /soltar [id]");
return 1;
}
plid = strval(tmp);
if(!IsPlayerConnected(plid)){
SendClientMessage(playerid, Vermelho, "(ERRO) O jogador nгo estб online");
return 1;
} else {
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
SendClientMessage(plid, Aviso, string);
dini_IntSet(file2, "Preso", 0);
preso[plid] = 0;
SetPlayerHealth(plid,100);
Preso[plid] = 0;
algemado[plid] = 0;
SpawnPlayer(plid);
SendClientMessage(playerid, COLOR_GREEN, "(INFO) Jogador Solto !");
return 1;
}
} else {
SendClientMessage(playerid,Vermelho,"(ERRO) Vocк nгo й um Advogado");
return 1;
}
}
ifs
pawn Код:
if(NaFaculdade[playerid] == 1) return SendClientMessage(playerid, Vermelho, "(ERRO) Vocк estб na biblioteca e nгo pode usar nenhum comando.");
if(preso[playerid] == 1) return SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo pode usar nenhum comando Preso, Na biblioteca ou Algemado).");
if(algemado[playerid] == 1) return SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo pode usar nenhum comando (Preso, Na biblioteca ou Algemado).");
Comando /algemar
pawn Код:
if(strcmp(cmd, "/algemar", 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_M || 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") == FBI || dini_Int(file, "Profissao") == Interpol ||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: /algemar [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 algemar vocк mesmo.");
return 1 ;
}
if(!IsPlayerConnected(plid)){
SendClientMessage(playerid, Vermelho, "(ERRO) O jogador nгo estб conectado");
return 1;
} else {
if(GetDistanceBetweenPlayers(plid,playerid) < 10){
format(string, sizeof(string), "(INFO) O Policial %s te algemou.", aname);
SendClientMessage(plid, Blue, string);
TogglePlayerControllable(plid, 0);
SendClientMessage(playerid, COLOR_GREEN, "(INFO) Algemado com sucesso.");
algemado[plid] = 1;
return 1;
} else {
SendClientMessage(playerid,Vermelho,"(ERRO) Chegue mais perto para algemar.");
return 1;
}
}
} else {
SendClientMessage(playerid,Vermelho,"(ERRO) Apenas policiais podem usar este comando.");
return 1;
}
}
Comando /desalgemar
pawn Код:
if(strcmp(cmd, "/desalgemar", 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_M || 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") == FBI || dini_Int(file, "Profissao") == Interpol || 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: /desalgemar [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 tirar algemas de vocк mesmo.");
return 1 ;
}
if(!IsPlayerConnected(plid)){
SendClientMessage(playerid, Vermelho, "(ERRO) O jogador nгo estб conectado");
return 1;
} else {
if(GetDistanceBetweenPlayers(plid,playerid) < 10){
format(string, sizeof(string), "(INFO) O Policial %s te desalgemou.", aname);
SendClientMessage(plid, Blue, string);
TogglePlayerControllable(plid, 1);
SendClientMessage(playerid, COLOR_GREEN, "(INFO) Desalgemado com sucesso.");
algemado[plid] = 0;
return 1;
} else {
SendClientMessage(playerid,Vermelho,"(INFO) Chegue mais perto para desalgemar.");
return 1;
}
}
} else {
SendClientMessage(playerid,Vermelho,"(INFO) Apenas policiais podem usar este comando.");
return 1;
}
}
Comando /prender
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;
}
}
Quase no final do GM
pawn Код:
algemado[playerid]=0;
No final do GM
pawn Код:
algemado[playerid] = 0;
Se precisar de mais alguma coisa sу pedir gente D: Desculpem pelo tуpico gigantesco й que sou novato em pawn podem me ajuda por favor ?


Muito obrigado!
Reply
#2

Qual sua Variбvel de Procurado?
Reply
#3

Quote:
Originally Posted by .FuneraL.
Посмотреть сообщение
Qual sua Variбvel de Procurado?
Nгo sei se й isto que vocк estб falando mas se nгo for eu procuro...

pawn Код:
if(dini_Int(file2, "DM") == 1){
new string[256];
format(string, sizeof(string), "(INFO) %s matou o jogador %s e esta sendo procurado!",kname, aname);
SendClientMessageToAll(msgdm3, string);
SendClientMessage(killerid, msgdm, "(INFO) Vocк estб sendo procurado por assasinato!");
SetPlayerWantedLevel(playerid, 6);
dini_IntSet(file, "Procurado", 1);
Procurados[playerid]= 1;
Procurados[killerid] = 1;
}
return 1;
}
Ou:

pawn Код:
if(strcmp(cmdtext, "/procurados", true) == 0){
SendClientMessage(playerid,0x008000AA,".:: Procurados ::.");
new Jogador[24];
new count = 0;
new msg[120];
for(new i=0; i<MAX_PLAYERS; i++){
if(IsPlayerConnected(i) && Procurados[i]){
GetPlayerName(i,Jogador,24);
format(msg,sizeof(msg),"%s (ID: %d)", Jogador,i);
SendClientMessage(playerid, 0x0088CAAA, msg);
count++;
}
}
if(count == 0){
SendClientMessage(playerid, 0xFF0000AA, "Ninguйm online esta Procurado!");
}
return 1;
}
Reply
#4

Po alguйm ajuda ai...
Reply
#5

pawn Код:
if(strcmp(cmdtext, "/procurados", true) == 0)
{
     SendClientMessage(playerid,0x008000AA,".:: Procurados ::.");
     new Jogador[24];
     new count = 0;
     new msg[120];
     for(new i=0; i<MAX_PLAYERS; i++)
     {
          if(IsPlayerConnected(i) && Procurados[i] >= 1)
          {
               GetPlayerName(i,Jogador,24);
               format(msg,sizeof(msg),"%s (ID: %d)", Jogador,i);
               SendClientMessage(playerid, 0x0088CAAA, msg);
               count++;
          }
     }
     if(count == 0){ SendClientMessage(playerid, 0xFF0000AA, "Ninguйm online esta Procurado!");}
     return 1;
}
Tente!

This forum requires that you wait 120 seconds between posts. Please try again in 10 seconds.
Reply
#6

Quote:
Originally Posted by @Riichard
Посмотреть сообщение
pawn Код:
if(strcmp(cmdtext, "/procurados", true) == 0)
{
     SendClientMessage(playerid,0x008000AA,".:: Procurados ::.");
     new Jogador[24];
     new count = 0;
     new msg[120];
     for(new i=0; i<MAX_PLAYERS; i++)
     {
          if(IsPlayerConnected(i) && Procurados[i] >= 1)
          {
               GetPlayerName(i,Jogador,24);
               format(msg,sizeof(msg),"%s (ID: %d)", Jogador,i);
               SendClientMessage(playerid, 0x0088CAAA, msg);
               count++;
          }
     }
     if(count == 0){ SendClientMessage(playerid, 0xFF0000AA, "Ninguйm online esta Procurado!");}
     return 1;
}
Tente!

This forum requires that you wait 120 seconds between posts. Please try again in 10 seconds.
Nгo deu certo, porйm eu peguei o GM BWE, e retirei o comando de lб e deu certo, sу que ainda tem o bug da pessoa prender outra sem ela estar procurada... e tambйm tem o que quando a pessoa esta algemada ela usa /afk e /on queria que nгo desse pra usar comandos algemado(a), Podem me ajudar ?
Reply
#7

troca la no seu OnPlayerDeath,
pawn Код:
if(dini_Int(file2, "DM") == 1){
new string[256];
format(string, sizeof(string), "(INFO) %s matou o jogador %s e esta sendo procurado!",kname, aname);
SendClientMessageToAll(msgdm3, string);
SendClientMessage(killerid, msgdm, "(INFO) Vocк estб sendo procurado por assasinato!");
SetPlayerWantedLevel(killerid, 6);
dini_IntSet(file, "Procurado", 1);
Procurados[killerid] = 1;
}
return 1;
}
Reply
#8

Quote:
Originally Posted by darkxdll
Посмотреть сообщение
troca la no seu OnPlayerDeath,
pawn Код:
if(dini_Int(file2, "DM") == 1){
new string[256];
format(string, sizeof(string), "(INFO) %s matou o jogador %s e esta sendo procurado!",kname, aname);
SendClientMessageToAll(msgdm3, string);
SendClientMessage(killerid, msgdm, "(INFO) Vocк estб sendo procurado por assasinato!");
SetPlayerWantedLevel(killerid, 6);
dini_IntSet(file, "Procurado", 1);
Procurados[killerid] = 1;
}
return 1;
}
Nгo mudou em nada o GM, mas valeu a intenзгo ;)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)