Kick everyone besides people with a certain name?
#1

Hello, I want to make a thing so if someone connects, and their name isnt coded into the server, then they're banned..

Its for a BETA testing, and its to help ensure that only beta's get in, and I am locking the server, but the testers can leak the password, so I want to know how I can make it only allow people that are coded into the server

Like for example, I know this wouldnt work but i'm wondering if theres a way of doing it this way

pawn Код:
public OnPlayerConnect(playerid)
{
    if PlayerName(playerid,"Player1");
    {
        SendClientMessage(playerid,color,"Welcome to the server, Player1);
    }
    else if PlayerName(playerid,"
Player2");
    {
        SendClientMessage(playerid,color,"
Welcome to the server, Player2);
    }
    else if PlayerName(playerid,"Player3");
    {
        SendClientMessage(playerid,color,"Welcome to the server, Player3);
    }
    else
    {
        SendClientMessage(playerid,color,"
You are not a beta tester! Banned!");
        BanEx(playerid,"
Beta Testing");
    }
    return 1;
}
??

Thanks
Reply
#2

Код:
OnPlayerConnect(playerid)
  {
  new nick[MAX_PLAYER_NAME];
  GetPlayerName(playerid, nick, sizeof(nick));
  if(strfind(nick,"tester1",true)!=-1||strfind(nick,"tester2",true)!=-1||strfind(nick,"tester3",true)!=-1)
    {
    //yo dawg u da tester welcome here xD
    }
  else
    {
    //yo dawg u not testerz, u be banned for sure now xD
    }
  return 1;
  }
Reply
#3

Quote:
Originally Posted by Ronyx69
Код:
OnPlayerConnect(playerid)
  {
  new nick[MAX_PLAYER_NAME];
  GetPlayerName(playerid, nick, sizeof(nick));
  if(strfind(nick,"tester1",true)!=-1||strfind(nick,"tester2",true)!=-1||strfind(nick,"tester3",true)!=-1)
    {
    //yo dawg u da tester welcome here xD
    }
  else
    {
    //yo dawg u not testerz, u be banned for sure now xD
    }
  return 1;
  }
It wont ban the people who arent listed..

I've tested it.

pawn Код:
public OnPlayerConnect(playerid)
{
  new nick[MAX_PLAYER_NAME];
  GetPlayerName(playerid, nick, sizeof(nick));
  if(strfind(nick,"[B]Vortex",true)!=-1||strfind(nick,"Lazlow",true)!=-1||strfind(nick,"AjayRz",true)!=-1||strfind(nick,"TehFedra",true)!=-1||strfind(nick,"Arsham_Vafa",true)!=-1)
    {
    SendClientMessage(playerid,COLOR_RED,"You are reconized as a BETA Tester, welcome");
    }
  else
    {
    SendClientMessage(playerid,COLOR_RED,"You are not a BETA Tester, banned.");
    BanEx(playerid,"BETA Testing.");
    }
  return 1;
}
Reply
#4

Код:
public OnPlayerConnect(playerid)
  {
  new nick[MAX_PLAYER_NAME];
  GetPlayerName(playerid, nick, sizeof(nick));
  if(strfind(nick,"[B]Vortex",true)==-1&&strfind(nick,"Lazlow",true)==-1&&strfind(nick,"AjayRz",true)==-1&&strfind(nick,"TehFedra",true)==-1&&strfind(nick,"Arsham_Vafa",true)==-1)
    {
    SendClientMessage(playerid,COLOR_RED,"You are not a BETA Tester, banned.");
    BanEx(playerid,"BETA Testing.");
    return 1;
    }
  else
    {
    SendClientMessage(playerid,COLOR_RED,"You are recognized as a BETA Tester, welcome");
    }
  return 1;
  }
Reply
#5

Quote:
Originally Posted by Ronyx69
Код:
public OnPlayerConnect(playerid)
  {
  new nick[MAX_PLAYER_NAME];
  GetPlayerName(playerid, nick, sizeof(nick));
  if(strfind(nick,"[B]Vortex",true)==-1&&strfind(nick,"Lazlow",true)==-1&&strfind(nick,"AjayRz",true)==-1&&strfind(nick,"TehFedra",true)==-1&&strfind(nick,"Arsham_Vafa",true)==-1)
    {
    SendClientMessage(playerid,COLOR_RED,"You are not a BETA Tester, banned.");
    BanEx(playerid,"BETA Testing.");
    return 1;
    }
  else
    {
    SendClientMessage(playerid,COLOR_RED,"You are recognized as a BETA Tester, welcome");
    }
  return 1;
  }
this would only "work" if the playerid was called ALL the names O_O
tho this bans the names XD

pawn Код:
public OnPlayerConnect(playerid)
  {
  new nick[MAX_PLAYER_NAME];
  GetPlayerName(playerid, nick, sizeof(nick));
  if(strcmp(nick, "TehFedra", true) == 0 || strcmp(nick, "[B]Vortex", true) == 0 || strcmp(nick, "Lazlow", true) == 0 || strcmp(nick, "AjayRz", true) == 0 || strcmp(nick, "Arsham_Vafa", true) == 0)
    {
    SendClientMessage(playerid,COLOR_RED,"You are recognized as a BETA Tester, welcome");
    return 1;
    }
  else
  SendClientMessage(playerid,COLOR_RED,"You are not a BETA Tester, banned.");
  BanEx(playerid,"BETA Testing.");
  return 1;
  }
thisone should work^^
Reply
#6

Quote:
Originally Posted by saiberfun
Quote:
Originally Posted by Ronyx69
Код:
public OnPlayerConnect(playerid)
  {
  new nick[MAX_PLAYER_NAME];
  GetPlayerName(playerid, nick, sizeof(nick));
  if(strfind(nick,"[B]Vortex",true)==-1&&strfind(nick,"Lazlow",true)==-1&&strfind(nick,"AjayRz",true)==-1&&strfind(nick,"TehFedra",true)==-1&&strfind(nick,"Arsham_Vafa",true)==-1)
    {
    SendClientMessage(playerid,COLOR_RED,"You are not a BETA Tester, banned.");
    BanEx(playerid,"BETA Testing.");
    return 1;
    }
  else
    {
    SendClientMessage(playerid,COLOR_RED,"You are recognized as a BETA Tester, welcome");
    }
  return 1;
  }
this would only "work" if the playerid was called ALL the names O_O
No. Look: it says "==-1" - it means that the player is NOT called all the names.
Reply
#7

ok didnt kno that but still it wasn't the right way u would have banned the betatesters^^
Reply
#8

Quote:
Originally Posted by [B
Vortex ]
Hello, I want to make a thing so if someone connects, and their name isnt coded into the server, then they're banned..

Its for a BETA testing, and its to help ensure that only beta's get in, and I am locking the server, but the testers can leak the password, so I want to know how I can make it only allow people that are coded into the server

Like for example, I know this wouldnt work but i'm wondering if theres a way of doing it this way

pawn Код:
public OnPlayerConnect(playerid)
{
    if PlayerName(playerid,"Player1");
    {
        SendClientMessage(playerid,color,"Welcome to the server, Player1);
    }
    else if PlayerName(playerid,"
Player2");
    {
        SendClientMessage(playerid,color,"
Welcome to the server, Player2);
    }
    else if PlayerName(playerid,"Player3");
    {
        SendClientMessage(playerid,color,"Welcome to the server, Player3);
    }
    else
    {
        SendClientMessage(playerid,color,"
You are not a beta tester! Banned!");
        BanEx(playerid,"
Beta Testing");
    }
    return 1;
}
??

Thanks
bump
Reply
#9

Quote:
Originally Posted by ssǝן‾ʎ
If the beta testers leak the password, can't you just use their password AND their name? It's dead easy to change your name in the server browser, it's been said MANY MANY times that any security based on names only is no security at all, as people can just lie.
yep u could just take thename of sum1 playing
tho if they dunno the names it wont be a problem.
u could set query 0
then noone sees whos on the server^^

and


Quote:
Originally Posted by XCultz
bump
why the **** u bump? O_O
u got what u need already

Quote:
Originally Posted by saiberfun
pawn Код:
public OnPlayerConnect(playerid)
  {
  new nick[MAX_PLAYER_NAME];
  GetPlayerName(playerid, nick, sizeof(nick));
  if(strcmp(nick, "TehFedra", true) == 0 || strcmp(nick, "[B]Vortex", true) == 0 || strcmp(nick, "Lazlow", true) == 0 || strcmp(nick, "AjayRz", true) == 0 || strcmp(nick, "Arsham_Vafa", true) == 0)
    {
    SendClientMessage(playerid,COLOR_RED,"You are recognized as a BETA Tester, welcome");
    return 1;
    }
  else
  SendClientMessage(playerid,COLOR_RED,"You are not a BETA Tester, banned.");
  BanEx(playerid,"BETA Testing.");
  return 1;
  }
thisone should work^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)