Posts: 49
Threads: 9
Joined: Sep 2010
Reputation:
0
25.10.2010, 18:42
(
Последний раз редактировалось ExEx; 25.10.2010 в 18:55.
)
How to make when player connect to server to check if hе have a roleplay name
If hе has Name_Surname ok
but if hе has
Name_surname
name_surname
name_Surname
name
kick !!
Posts: 49
Threads: 9
Joined: Sep 2010
Reputation:
0
i searched , i not found nothing !
Posts: 415
Threads: 25
Joined: Apr 2008
Reputation:
0
Edit: Nvm, let me rephrase that.
Posts: 49
Threads: 9
Joined: Sep 2010
Reputation:
0
I just found this
new plname[MAX_PLAYER_NAME];
GetPlayerName(playerid, plname, sizeof(plname));
new namestring = strfind(plname, "_", true);
if(namestring == -1)
{
SendClientMessage(playerid, COLOR_RED, "Your name must be in the format Firstname_Lastname.");
Kick(playerid);
return 1;
}
But this kick me when my name is NameSurname or Namexxxxx but not kick me when my name is name_surname
I want only players with Name_Surname join my server !
not name_surname or Name_surname Name_surname !
please !
Posts: 70
Threads: 7
Joined: Oct 2010
Dude search in other GM'S!
Posts: 2,593
Threads: 34
Joined: Dec 2007
pawn Код:
stock CheckRPName(p)
{
new Nick[24],pos;
GetPlayerName(p,Nick,24);
pos = strlen(Nick);
for(new d; d < pos; d++)
if(Nick[d] == '_') {
pos = d+1;
break;
}
return ((65 <= Nick[0] <= 90) && (65 <= Nick[pos] <= 90)) ? true : false;
}
Connect
pawn Код:
if(!CheckRPName(playerid)) // if name is not Name_Surname
{
//SCM Correct name Firstname_Lastname
Kick(playerid);
}
Posts: 49
Threads: 9
Joined: Sep 2010
Reputation:
0
THANKS Jefff
you rock bro xD