Roleplay connect
#1

my problem is when player with wrong name connect to the game, give him the registration dialog and the message " This is a RolePlay Server, please reconnect using Firstname_Lastname format. "
this OnPlayerConnect callback:
pawn Код:
new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    if(fexist(Path(playerid)))
    {
        INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT,"Login","Welcome back. This account is registered. \nType your password to login to your account","Login","Quit");/*A dialog with input style will appear so you can insert your password to login.*/
    }
    else
    {
        if(strfind(name, "0", true) != -1 || strfind(name, "1", true) != -1 || strfind(name, "2", true) != -1 || strfind(name, "3", true) != -1 || strfind(name, "4", true) != -1 || strfind(name, "5", true) != -1
        || strfind(name, "6", true) != -1 || strfind(name, "7", true) != -1 || strfind(name, "8", true) != -1 || strfind(name, "9", true) != -1 || strfind(name, "[", true) != -1 || strfind(name, "]", true) != -1
        || strfind(name, "_", true) == -1)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}This is a RolePlay Server, please reconnect using Firstname_Lastname format.");
            SetTimer("KickP", 1000, true);
        }
        else if(strfind(name, "_", true) != -1)
        {
        ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.","Register","Quit");
        }
        return 1;
    }
pawn Код:
stock Path(playerid)
{
    new str[128],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(str,sizeof(str),UserPath,name);
    return str;
}
pawn Код:
forward KickP(playerid);
public KickP(playerid)
{
    Kick(playerid);
    return 1;
}
Reply
#2

OnPlayerConnect
pawn Код:
if(fexist(Path(playerid)))
    {
         INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra = true, .extra = playerid);
         ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT,"Login","Welcome back. This account is registered. \nType your password to login to your account","Login","Quit");/*A dialog with input style will appear so you can insert your password to login.*/
    }
    else
    {
             ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.","Register","Quit");
     }
I just edited deleted some lines within if(fexist....)) - Showing register dialog.
Reply
#3

your reply doesn't help me, if you have helpful reply so please
Reply
#4

bumb
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)