[Ajuda] Cmd /soltar
#1

Ajuda com comando de soltar.
o comando esta soltando atй players q nao estao presos.
Dai vcs pensam qual o problema disso ? o problema й q quando o player й solto ele й desbugado automaticamente.
Entao tem alguns players q soltam os players quando erra o id e etc , dai o player desbuga sem querer.
Aki esta o comando:
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(pAdmin[playerid]  == 1 || pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || dini_Int(file, "Profissao") == Prefeito || dini_Int(file, "Profissao") == Presidente ||  dini_Int(file, "Profissao") == Guardiao || dini_Int(file, "Profissao") == Advogado || pAdmin[playerid] == 5){
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;
}
}
Acho q й algo relacionado a isso:
pawn Код:
if(Presos[plid] == 0){
SendClientMessage(playerid, Vermelho, "Este Player nao Esta Preso. ");
return 1;
} else {
Mas eu nao seii onde coloca isso.
Reply
#2

Quote:
Originally Posted by alexandreez
Посмотреть сообщение
Ajuda com comando de soltar.
o comando esta soltando atй players q nao estao presos.
Dai vcs pensam qual o problema disso ? o problema й q quando o player й solto ele й desbugado automaticamente.
Entao tem alguns players q soltam os players quando erra o id e etc , dai o player desbuga sem querer.
Aki esta o comando:
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(pAdmin[playerid]  == 1 || pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || dini_Int(file, "Profissao") == Prefeito || dini_Int(file, "Profissao") == Presidente ||  dini_Int(file, "Profissao") == Guardiao || dini_Int(file, "Profissao") == Advogado || pAdmin[playerid] == 5){
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;
}
}
Acho q й algo relacionado a isso:
pawn Код:
if(Presos[plid] == 0){
SendClientMessage(playerid, Vermelho, "Este Player nao Esta Preso. ");
return 1;
} else {
Mas eu nao seii onde coloca isso.
Retire o Else e coloque isto no inicio do CMD:

pawn Код:
if(Presos[plid] == 0) return SendClientMessage(playerid, Vermelho, "Este Player nao Esta Preso. ");
Reply
#3

Nessa parte:
pawn Код:
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);
Deixe a dini do Preso assim:
pawn Код:
dini_IntSet(file2, "Preso", 1);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)