Need help
#1

Hi.. Maybe someone know how to do pseudonym script that I need? I need pseudonym like this Name_Lastname. If in pseudonym are more or less than 2 capital letters, player would be kicked. Please help me, I really need this.
Reply
#2

Quote:
Originally Posted by lakierka
Hi.. Maybe someone know how to do pseudonym script that I need? I need pseudonym like this Name_Lastname. If in pseudonym are more or less than 2 capital letters, player would be kicked. Please help me, I really need this.
EDIT: I have Name_Lastname script, but I need letters script

Sorry for double post.. I pressed wrong button..

Here script:
Код:
stock InvalidNickKick(playerid)
{
  new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid,name,sizeof(name));
  new where = strfind(name,"_",true);
  new lenght = strlen(name)-1;
  new invalid = strfind(name,"[",true);
  if(invalid == -1) invalid = strfind(name,"]",true);

  if(where == 0 || where == lenght || where==-1)
  {
	  SendClientMessage(playerid,zaliaigeltona,"* [LVRP]: Your pseudonym wrong.");
	  SendClientMessage(playerid,zaliaigeltona,"* [LVRP]: Rigth pseudonym:");
	  SendClientMessage(playerid,zaliaigeltona,"* [LVRP]: Name_Lastname");
	  Kick(playerid);
	  return 1;
	 }

	 if(strlen(name[where])<4)
	 {
	  SendClientMessage(playerid,zaliaigeltona,"* [LVRP]: Your lastname to short");
	  SendClientMessage(playerid,zaliaigeltona,"* [LVRP]: Rigth pseudonym:");
	  SendClientMessage(playerid,zaliaigeltona,"* [LVRP]: Name_Lastname");
	  Kick(playerid);
	  return 1;
	 }

	 if(where<3)
	 {
	  SendClientMessage(playerid,zaliaigeltona,"* [LVRP]: Your name to short");
	  SendClientMessage(playerid,zaliaigeltona,"* [LVRP]: Rigth pseudonym:");
	  SendClientMessage(playerid,zaliaigeltona,"* [LVRP]: Name_Lastname");
	  Kick(playerid);
	  return 1;
	 }

	 if(invalid != -1)
	 {
	  SendClientMessage(playerid,zaliaigeltona,"* [LVRP]: Into your name are bad simbols.");
	  SendClientMessage(playerid,zaliaigeltona,"* [LVRP]: Rigth pseudonym:");
	  SendClientMessage(playerid,zaliaigeltona,"* [LVRP]: Name_Lastname");
	  Kick(playerid);
	  return 1;
	 }
	 return 0;
}
Reply
#3

Try something like this under OnPlayerConnect
pawn Код:
new name[MAX_PLAYER_NAME],count[MAX_PLAYERS];
  GetPlayerName(playerid, name, sizeof(name));
  count[playerid]=0;
  for(new a=0;a<MAX_PLAYER_NAME;a++)
    {
        if (!('A' <= name[a] <= 'Z')) //checks if the name has capital letters
        {
          count[playerid]++;
          if (count[playerid]==3) //if 3, then kick
          {
            SendClientMessage(playerid,0xAA3333AA,"Your name can have only 2 capital letters");
            Kick(playerid);
          }
        }
    }
Reply
#4

Something wrong. On game my name is Dare_James. When I connect to my server, server types me your message: Your name can have only 2 capital letters. Can you fix it? Please, I'd be very thankful.

EDIT: When I type my name Dare_james or dare_james, server kicks me nevertheless.
Reply
#5

Sorry for double posting, but I really really need this script.. Please help me.
Reply
#6

Try just removing the '!' in the if statement
Reply
#7

Thanks.. You really helped me.. But server kicks player only if in his name are more than 2 capital letters. I need that it's would kick player if in his name are less than 2 capital letters. I've tried something like that:
Код:
if (count[playerid] <2 || >3)
if (count[playerid]==3 || <2)
but pawno shows error..
Reply
#8

Quote:
Originally Posted by lakierka
Thanks.. You really helped me.. But server kicks player only if in his name are more than 2 capital letters. I need that it's would kick player if in his name are less than 2 capital letters. I've tried something like that:
Код:
if (count[playerid] <2 || count >3)
if (count[playerid]==3 || count <2)
but pawno shows error..
Reply
#9

Quote:
Originally Posted by cj101
Quote:
Originally Posted by lakierka
Thanks.. You really helped me.. But server kicks player only if in his name are more than 2 capital letters. I need that it's would kick player if in his name are less than 2 capital letters. I've tried something like that:
Код:
if (count[playerid] <2 || count >3)
if (count[playerid]==3 || count <2)
but pawno shows error..
It's works, but.. You should to do like this:
Код:
if (count[playerid]<2 || count[playerid]>3)
But server kicks player when in his name is just 1 capital letter. When in name are no capital letters, player can connect still.. I've tried like this:
Код:
if (count[playerid]==0 || count[playerid]==1 || count[playerid]==3)
But player can connect.. I know, I'm going to piss off all of you but I need help.
Reply
#10

Try this
pawn Код:
if (!(count[playerid]==2)) /*will kick, if the player doesn't have 2 caps in his name*/
Or you could do it the long way
pawn Код:
if ((count[playerid]<=1) || (count[playerid]>=3))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)