09/09/2022 22:08
O ip é desbanido mais não to conseguindo apagar o ip desse arquivo.txt tem alguma coisa faltando?
aquie é como o arquivo é salvo.
Ips.txt
Código PHP:
CMD:desbanir(playerid, params[])
{
new IP[25];
if(PlayerInfo[playerid][pAdmin] < 5)
return SendClientMessage(playerid,Vermelho,"Você não tem permissão para isso!");
if(sscanf(params, "s", IP)) return SendClientMessage(playerid, CINZA, " Use /desbanirip [IP]");
if(!DOF2_IsSet("BANIDOS/Ips.txt", IP)) return SendClientMessage(playerid, CINZA, "Este IP não está banido!");
DOF2_Unset("BANIDOS/Ips.txt", IP);
format(String, sizeof(String), "IP %s Desbanido pelo admin %s!", IP, Nome(playerid));
SendClientMessageToAll(AZUL_CLARO, String);
return 1;
}
Código PHP:
CMD:ban(playerid, params[])
{
new Motivo[128];
new Str2[128];
new Ip[25];
new ID;
//new Banido;
if(PlayerInfo[playerid][pAdmin] < 5)
return SendClientMessage(playerid,Vermelho,"Você não tem permissão para isso!");
if(!DOF2_FileExists("BANIDOS/Ips.txt")) DOF2_CreateFile("BANIDOS/Ips.txt");
GetPlayerIp(ID, Ip, 25);
format(String, sizeof(String), "%s", Ip);
format(Str2, sizeof(Str2), "Admin: %s - Motivo: %s", Nome(playerid), Motivo);
DOF2_SetString("BANIDOS/Ips.txt", String, Str2);
format(String, sizeof(String), " O Admin {1B95E0}%s{00C2EC} Baniu definitivamente o jogador {1B95E0}%s{00C2EC} pelo motivo: %s\r\n", Nome(playerid), Nome(ID), Motivo);
SendClientMessageToAll(AZUL_CLARO, String);
Ban(ID);
return 1;
}
aquie é como o arquivo é salvo.
Ips.txt
Código PHP:
127.0.0.1 = Admin: junior - Motivo: teste