29.08.2014, 14:00
Olб, eu criei esse CMD de banir e salavr um uma pasta e gostria q vocкs me ajudassem, tipo ban uma peessoa e salva certo so q quando bani outra apaga a que ja foi banida e salva o ban novo, ou seja, quem estava banido nгo esta mais.
Gostaria tbn que quando o player logasse pegasse nessa pasta bans.ini e verificasse se ele estava banido.
Gostaria tbn que quando o player logasse pegasse nessa pasta bans.ini e verificasse se ele estava banido.
pawn Код:
CMD:banir(playerid, params[])
{
new file[40], aName[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME], pIp[25], Motivo[25], str[128], str1[128], id;
GetPlayerName(playerid,aName, MAX_PLAYER_NAME);
GetPlayerName(id,pName, MAX_PLAYER_NAME);
GetPlayerIp(playerid, pIp, sizeof(pIp));
format(file, 40, PASTA_BANS);
if(IsPlayerAdmin(playerid) || Admin[playerid] == 1 || Admin[playerid] == 2){
if(sscanf(params,"us",id,Motivo)) return SendClientMessage(playerid, Vermelho, "| ERRO |{ffffff} Digite: /Banir [id] [motivo]");
if(DOF2_FileExists(file)){
format(str1, sizeof(str1), "Nick: %s || IP: %s || Motivo %s || Administrador: %s", pName, pIp, Motivo, aName);
DOF2_SetString(file, "->", str1);
DOF2_SaveFile();
}
else
{
DOF2_CreateFile(file, "Bans.ini");
format(str1, sizeof(str1), "Nick: %s || IP: %s || Motivo %s || Administrador: %s", pName, pIp, Motivo, aName);
DOF2_SetString(file, "->", str1);
DOF2_SaveFile();
}
format(str, sizeof(str), "[Admin] O(A) administrador(a) %s baniu %s (Motivo: %s)",aName,pName,Motivo);
SendClientMessageToAll(azuladm, str);
print(str);
}
else
{
SendClientMessage(playerid, Laranja, "| ERRO | Vocк nгo й administrador(a)");
}
return 1;
}