[NEED ANSWERS FAST!!] Planning on createing TempBan include but stuck at unban! - Micko9 - 01.04.2010
well i had thought of some idea like an /unban [IP] command but i seem not to get the part with removeing the ban ex : i cant find how to get a specified line , the the ban.txt looks like this :
Код:
127.0.0.1 // Reason : ...
444.444.444.444 // reason : ...
( i do not have the script but while im first planning what to do i got to this thread )
now idk how to remove 1 of them example the player does this :
/unban 127.0.0.1
It checks the text file for "127.0.0.1 //" and removes that line . also this time im working on a Temporary Ban...but that looks even harder , cause the format is like : "%d|%d|%d|%d" ...any help?
Re: [NEED ANSWERS FAST!!] Planning on createing TempBan include but stuck at unban! -
Daniel_Truk - 01.04.2010
pawn Код:
#define COLOR_GRAD1 0xB4B5B7FF // Add it on the top with all other defines
if(strcmp(cmd,"/unbanip",true)==0)
{
if(!IsPlayerAdmin(playerid))// gotta be rconlogged
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /unbanip [players ip]");
return 1;
}
format(string,sizeof(string),"unbanip %s",tmp);
SendRconCommand(string);
SendRconCommand("reloadbans");
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
}
return 1;
}
/cake
Re: [NEED ANSWERS FAST!!] Planning on createing TempBan include but stuck at unban! -
Daniel_Truk - 01.04.2010
Wops Computer lagged double posted sorry
Re: [NEED ANSWERS FAST!!] Planning on createing TempBan include but stuck at unban! - Micko9 - 01.04.2010
Quote:
Originally Posted by Cake.
pawn Код:
#define COLOR_GRAD1 0xB4B5B7FF // Add it on the top with all other defines
if(strcmp(cmd,"/unbanip",true)==0) { if(!IsPlayerAdmin(playerid))// gotta be rconlogged { tmp = strtok(cmdtext,idx); if(!strlen(tmp)) { SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /unbanip [players ip]"); return 1; } format(string,sizeof(string),"unbanip %s",tmp); SendRconCommand(string); SendRconCommand("reloadbans"); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); } return 1; }
/cake
|
thats not my problem .
my point isnt to do this unban from samp.ban then from my custom file example : myserverdir/tempbans.txt
Re: [NEED ANSWERS FAST!!] Planning on createing TempBan include but stuck at unban! - Micko9 - 01.04.2010
Quote:
Originally Posted by Micko9
Quote:
Originally Posted by Cake.
pawn Код:
#define COLOR_GRAD1 0xB4B5B7FF // Add it on the top with all other defines
if(strcmp(cmd,"/unbanip",true)==0) { if(!IsPlayerAdmin(playerid))// gotta be rconlogged { tmp = strtok(cmdtext,idx); if(!strlen(tmp)) { SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /unbanip [players ip]"); return 1; } format(string,sizeof(string),"unbanip %s",tmp); SendRconCommand(string); SendRconCommand("reloadbans"); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); } return 1; }
/cake
|
thats not my problem .
my point isnt to do this unban from samp.ban then from my custom file example : myserverdir/tempbans.txt
|
sorry for the bump just i didnt mean its not my problem like an insult just what you explain didnt slove my prob ...
Re: [NEED ANSWERS FAST!!] Planning on createing TempBan include but stuck at unban! -
Thrarod - 01.04.2010
Tried using timers?
Re: [NEED ANSWERS FAST!!] Planning on createing TempBan include but stuck at unban! - Micko9 - 01.04.2010
Quote:
Originally Posted by Thrarod
Tried using timers?
|
-.- then it wouldnt work if the server wood shutdown .
Re: [NEED ANSWERS FAST!!] Planning on createing TempBan include but stuck at unban! -
02manchestera - 01.04.2010
Well i dont no how but i no you need a date system s you need to say what date they are unbanned
Re: [NEED ANSWERS FAST!!] Planning on createing TempBan include but stuck at unban! - Micko9 - 01.04.2010
Quote:
Originally Posted by MR Loose Brackets
Well i dont no how but i no you need a date system s you need to say what date they are unbanned
|
yes i figured that out but cant figure my current problem .
Re: [NEED ANSWERS FAST!!] Planning on createing TempBan include but stuck at unban! -
Mikep. - 01.04.2010
I used to use individual files for each ban, in a directory. Or, use mySQL.