[HELP]Command [INI][REP]
#1

pawn Код:
CMD:sban(playerid, params[])
{
new fstring[250], log[250], ban[200];
if(sscanf(params,"i",ban)) {
SendClientMessage(playerid, RED,"USAGE: /sban [IP]");
}
format(log, sizeof(log),"AVC/Logs/BanLog.txt");
if(!fexist(log)) return SendClientMessage(playerid, RED,"BanLogs.txt doesn't exist in the AVC folder!");
INI_Open(log);
INI_StripLine(ban);
INI_Close();
format(fstring, sizeof(fstring),"%s",ban);
SendClientMessage(playerid, RED,fstring);
return 1;
}
I want to make /searchban command to search ban for a particular IP.. but it doesn't works.. "above".
Can anyone help ?
I use SII

+REP for sure..
Reply
#2

Replace it with
pawn Код:
CMD:sban(playerid, params[])
{
new fstring[250], log[110], ban[200];
if(sscanf(params,"i",ban)) {
SendClientMessage(playerid, RED,"USAGE: /sban [IP]");
}
format(log, sizeof(log),"AVC/Logs/BanLog.txt");
if(!fexist(log))
return SendClientMessageEx(playerid, RED,"BanLogs.txt doesn't exist in the AVC folder!");
INI_Open(log);
INI_StripLine(ban);
INI_Close();
format(fstring, sizeof(fstring),"%s",ban);
SendClientMessage(playerid, RED,fstring);
return 1;
}
Reply
#3

Try this maybe will work ..
pawn Код:
CMD:sban(playerid, params[])
{
new fstring[250];
new log[110];
new ban[200];

if(sscanf(params,"i",ban))
{
SendClientMessage(playerid, RED,"USAGE: /sban [IP]");
}
format(log, sizeof(log),"AVC/Logs/BanLog.txt");
if(!fexist(log))
return SendClientMessageEx(playerid, RED,"BanLogs.txt doesn't exist in the AVC folder!");
INI_Open(log);
INI_StripLine(ban);
INI_Close();
format(fstring, sizeof(fstring),"%s",ban);
SendClientMessage(playerid, RED,fstring);
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)