Name ban,and IP ban -
budelis - 02.08.2011
Hello peoples.I want to ask.I have created ban system who if player first time banned he get name ban,but one problem,I don't know when player get name ban,and he come again with another name,and get ban again,he get IP ban,how to do that?
Re: Name ban,and IP ban -
Kush - 02.08.2011
If you asking how to ban a player's IP. Use the Ban function.
https://sampwiki.blast.hk/wiki/Ban
Re: Name ban,and IP ban -
Godhimself - 02.08.2011
save there IP as banned under ban command. On connect check if they have a banned IP, if so kick them as a banned IP.
Re: Name ban,and IP ban -
budelis - 02.08.2011
Код:
for(new v = 0; v < MAX_PLAYERS; v ++ )
{
new pIP [ 50 ];
new pFiles [ 50 ];
format(pFiles, sizeof(pFiles), "saves/user/%s.ini", PlayerName(v));
new Ipas = dini_Int(pFiles,"IP Adresas");
new Banas = dini_Int(pFiles,"Banned");
if(dini_Exists(pFiles)){
if(GetPlayerIp(IDs, pIP, sizeof(pIP) == Ipas && Banas == 1 ))
{
Ban( IDs );
What is wrong in this code?
Re: Name ban,and IP ban -
woot - 02.08.2011
GetPlayerIp is used wrongly and returns a string, not an integer - you can't compare IP addresses like that;
https://sampwiki.blast.hk/wiki/GetPlayerIp
Re: Name ban,and IP ban -
budelis - 02.08.2011
Then how to do that?Help me i have almost have created my ban system only this needed.
Respuesta: Name ban,and IP ban -
Alex_Obando - 02.08.2011
pawn Код:
if (strcmp(cmdtext, "/banip", true) == 0)
{
if(IsPlayerAdmin(playerid))
{
new string[200], pname[28];
GetPlayerName(playerid, pname, sizeof(pname));
format(string,sizeof(string),"%s banned the Ip %s",pname,cmd);
SendClientMessageToAll(0xDEEE20FF, string);
SendRconCommand("banip");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "You are not admin");
return 1;
}
}
Re: Respuesta: Name ban,and IP ban -
[MG]Dimi - 02.08.2011
pawn Код:
format(string,sizeof(string),"%s banned the Ip %s",pname,cmd);
SendClientMessageToAll(0xDEEE20FF, string);
SendRconCommand("banip");
and that won't work. You have to format command also in format "format(command,sizeof(command),"banip %s", Ip); and then use SendRconCommand(command);
Re: Name ban,and IP ban -
budelis - 02.08.2011
You don't understand,i repeat again that what i need.First of all,when admin ban player for first time,player gets NAME BAN,I have do that,but i want,when player come back to server with another name,and get again ban he not get no name ban but IP BAN,how to do that?
Re: Name ban,and IP ban -
[MG]Dimi - 02.08.2011
So to make variable for Ip that will check if player's connect IP has already been used with banned nickname., If Yes, to ban him?