28.07.2012, 12:42
Esse comando vem apresentando problemas, ele estб soltando atй pessoas que nгo estгo presas
pawn Код:
if(strcmp(cmd, "/soltar", true) == 0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), P_CONTAS, aname);
if(dini_Int(file, "pAdm01") == 1 || dini_Int(file, "Profissao") == Advogado || dini_Int(file, "Profissao") == Governador || dini_Int(file, "Profissao") == Prefeito || IsPlayerAdmin(playerid))
{
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, Vermelho, "{0099FF}[x]{CCCCFF} Use: /soltar [id]");
return 1;
}
plid = strval(tmp);
if(gettime() - TempoComando[playerid] < 60) return SendClientMessage(playerid, 0xFF0000FF, "Vocк tem que esperar 1 minuto para poder usar o comando novamente !");
TempoComando[playerid] = gettime();
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б online");
}
else
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), P_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);
format(string, sizeof(string), "{0099FF}[x]{CCCCFF} O Advogado %s (%d) tirou o preso : %s (%d) da Prisгo", aname,playerid,pname,plid);
SendClientMessageToAll(outraadm, string);
}
}
else
{
SendClientMessage(playerid,Vermelho,"{0099FF}[x]{CCCCFF} Vocк nгo й um Advogado");
}
return 1;
}