10.10.2012, 14:59
Pessoal eu criei um comando de banir ip atй ai tudo bem, mais ele sу funciona com numeros inteiros, quando eu escrevo numeros quebrados igual ip ele nгo vai, existe alguma funзгo prуpria pra ip no sscanf? vou deixar o cуdigo abaixo
pawn Код:
CMD:banirip(playerid, params[])
{
new String[128], arquivo[64], NomeA[28], Motivo[128], IP[26];
if(PlayerInfo[playerid][Admin] < 3)return SendClientMessage(playerid, Vermelho, "[ERRO]Vocк nгo tem permissгo para usar esse comando.");
if(sscanf(params,"d[26]s[128]",IP,Motivo)) return SendClientMessage(playerid,Vermelho,"[USE]: /banirip [IP] [motivo]");
GetPlayerName(playerid, NomeA, 28);
new str[64], year, month, day, hour, minute, second;
getdate(year, month, day);
gettime(hour, minute, second);
format(String, sizeof(String), " -OperServer- O IP %d foi banido pelo Administrador %s motivo: %s ",IP, NomeA, Motivo);
SendClientMessageToAll(Vermelho,String);
format(String, sizeof(String), "%d", IP);
format(arquivo, 64,"IPSBanidos/%d.ini",String);
DOF2_CreateFile(arquivo);
DOF2_SetString(arquivo, "Admin", NomeA);
format(String, sizeof(String), "%s", Motivo);
DOF2_SetString(arquivo, "Motivo", String);
format(str, sizeof(str), "%02d", day);
DOF2_SetString(arquivo, "Dia", str);
format(str, sizeof(str), "%02d", month);
DOF2_SetString(arquivo, "Mes", str);
format(str, sizeof(str), "%02d", year);
DOF2_SetString(arquivo, "Ano", str);
format(str, sizeof(str), "%02d", hour);
DOF2_SetString(arquivo, "Horas", str);
format(str, sizeof(str), "%02d", minute);
DOF2_SetString(arquivo, "Minutos", str);
format(str, sizeof(str), "%02d", second);
DOF2_SetString(arquivo, "Segundos", str);
DOF2_SaveFile();
return true;
}