• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
samp.ban
#1
Meu comando de ban adiciona um arquivo .ini (dof2) numa pasta bans e ipbans, e adiciona o IP na samp.ban.?



Eu quero desativar que o comando ban adicione o ip na samp.ban



C?digo



PHP Code:
#define Ban(%0) SetTimerEx("Banir", 200, false, "i", %0)



function::Banir(playerid) {

#undef Ban

Ban(playerid);

#define Ban(%0) SetTimerEx("Banir", 200, false, "i", %0)

return 1;

}



CMD:banir(playerid, params[])

{

if (!
APlayerData[playerid][pLogged])

? ? return 
SendClientMessage(playerid, COLOR_GRAD1, " Voc? n?o est? logado.");

? ? if (
APlayerData[playerid][pAdmin] < 1)

? ? ? ? return 
SendClientMessage(playerid, COLOR_GRAD1, "? Voc? n?o ? um administrador.");



? ? new 
id, ReasonBan1[30], Stringa[156];

? ? if (
sscanf(params, "us[30]", id, ReasonBan1))

? ? ? ? return 
SendClientMessage(playerid, COLOR_GRAD1, " (DICA): Use (/ban) [ID/Parte do nome] [Reason]");

? ? 

? ? if (
APlayerData[id][pLogged] > APlayerData[playerid][pLogged])

? ? ? ? return 
SendClientMessage(playerid, COLOR_GRAD1, "? Voc? n?o pode banir um administrador de n?vel maior que o seu.");



? ? if (
id == playerid)

? ? ? ? return 
SendClientMessage(playerid, COLOR_GRAD1, "Voc? n?o pode banir a si mesmo");



if(
APlayerData[playerid][pAdmin] > 0)

{

? ? 
DOF2_CreateFile(GetBanFile(id));

? ? 
DOF2_SetString(GetBanFile(id), "Name", pName[id]);

? ? 
DOF2_SetString(GetBanFile(id), "Admin", pName[playerid]);

? ? 
DOF2_SetString(GetBanFile(id), "Reason", ReasonBan1);

? ? 
DOF2_SetString(GetBanFile(id), "Date", GetDate());

? ? 
DOF2_SetString(GetBanFile(id), "IP", pIP[id]);

? ? 
DOF2_SaveFile();



? ? 
DOF2_CreateFile(GetIPFile(id));

? ? 
DOF2_SetString(GetIPFile(id), "Name", pName[id]);

? ? 
DOF2_SetString(GetIPFile(id), "Admin", pName[playerid]);

? ? 
DOF2_SetString(GetIPFile(id), "Reason", ReasonBan1);

? ? 
DOF2_SetString(GetIPFile(id), "Date", GetDate());

? ? 
DOF2_SetString(GetIPFile(id), "IP", pIP[id]);

? ? 
DOF2_SaveFile();



? ? ? ? 
format(Stringa, sizeof(Stringa), "%s %s baniu o player %s, motivo: %s",AdmCargo[APlayerData[playerid][pAdmin]], pName[playerid], pName[id], ReasonBan1);

? ? 
SendClientMessageToAll(COLOR_LIGHTRED, Stringa);



? ? 
format(Stringa, sizeof(Stringa), "BanLog: %s foi banido pelo admin %s, motivo: %s (%s)", pName[id], pName[playerid], ReasonBan1, GetDate());

? ? 
BanLog(Stringa);



Ban(id);

}

else if(
APlayerData[playerid][pAdminTemp] > 0)

{

? ? 
DOF2_CreateFile(GetBanFile(id));

? ? 
DOF2_SetString(GetBanFile(id), "Name", pName[id]);

? ? 
DOF2_SetString(GetBanFile(id), "Admin", pName[playerid]);

? ? 
DOF2_SetString(GetBanFile(id), "Reason", ReasonBan1);

? ? 
DOF2_SetString(GetBanFile(id), "Date", GetDate());

? ? 
DOF2_SetString(GetBanFile(id), "IP", pIP[id]);

? ? 
DOF2_SaveFile();



? ? 
DOF2_CreateFile(GetIPFile(id));

? ? 
DOF2_SetString(GetIPFile(id), "Name", pName[id]);

? ? 
DOF2_SetString(GetIPFile(id), "Admin", pName[playerid]);

? ? 
DOF2_SetString(GetIPFile(id), "Reason", ReasonBan1);

? ? 
DOF2_SetString(GetIPFile(id), "Date", GetDate());

? 
DOF2_SetString(GetIPFile(id), "IP", pIP[id]);

? ? 
DOF2_SaveFile();



? ? ? ? 
format(Stringa, sizeof(Stringa), "%s %s baniu o player %s, motivo: %s", AdmCargo[APlayerData[playerid][pLogged]], pName[playerid], pName[id], ReasonBan1);

? ? 
SendClientMessageToAll(COLOR_LIGHTRED, Stringa);



? ? 
format(Stringa, sizeof(Stringa), "BanLog: %s foi banido pelo admin %s, motivo: %s (%s)", pName[id], pName[playerid], ReasonBan1, GetDate());

? ? 
BanLog(Stringa);



? ? ? ? 
Ban(id);

}

? ? return 
1;

} 
  Reply
#2
retire o Ban(playerid);
  Reply