A little help with my registration system.
#1

Hello, I decided to make a game mode with other scripters together, in an attempt to create a community. Well, I have a slight problem. I know it compiles and all, but I'm %40 sure it won't work in-game, here is my code, and the Warnings I receive.

Warning:
Код:
\
C:\National Gaming Roleplay CS\gamemodes\Roleplay.pwn(102) : warning 202: number of arguments does not match definition
C:\National Gaming Roleplay CS\gamemodes\Roleplay.pwn(102) : warning 202: number of arguments does not match definition
C:\National Gaming Roleplay CS\gamemodes\Roleplay.pwn(134) : warning 225: unreachable code
C:\National Gaming Roleplay CS\gamemodes\Roleplay.pwn(135) : warning 202: number of arguments does not match definition
C:\National Gaming Roleplay CS\gamemodes\Roleplay.pwn(135) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Warnings.
It only happens when adding this code:
pawn Код:
new name[MAX_PLAYER_NAME]; //Making a new variable called 'name'. name[MAX_PLAYER_NAME] is created so we can use it to get player's name.
    GetPlayerName(playerid,name,sizeof(name)); //Get player's name
    if(fexist(Path(playerid))) /* Check if the connected user is registered or not. fexist stands for file exist. So if file exist in the files(Path(playerid)),*/
    {// then
        INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra = true, .extra = playerid); //Will load user's data using INI_Parsefile.
        ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT,"Login","Welcome back. This account is registered. \nInsert 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 the connected user is not registered,
    {//then we will 'force' him to register :)
        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;
    }
    return 1;
To this:
pawn Код:
public OnPlayerConnect(playerid) {
    if(! RoleplayNameCheck(GetPlayerName(playerid))) { // Le name checker
        SendClientMessage(playerid, -1, ""Red"Your name is not in Firstname_Lastname format! "White"Please correct it."); // The message sent.
        Kick(playerid); // Kicks the invalid player.
    }
    return true;
    new name[MAX_PLAYER_NAME]; //Making a new variable called 'name'. name[MAX_PLAYER_NAME] is created so we can use it to get player's name.
    GetPlayerName(playerid,name,sizeof(name)); //Get player's name
    if(fexist(Path(playerid))) /* Check if the connected user is registered or not. fexist stands for file exist. So if file exist in the files(Path(playerid)),*/
    {// then
        INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra = true, .extra = playerid); //Will load user's data using INI_Parsefile.
        ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT,"Login","Welcome back. This account is registered. \nInsert 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 the connected user is not registered,
    {//then we will 'force' him to register :)
        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;
    }
    return 1;
}
Reply


Messages In This Thread
A little help with my registration system. - by xSiiiLenTx - 02.01.2013, 21:52
Re: A little help with my registration system. - by park4bmx - 02.01.2013, 21:57
Re: A little help with my registration system. - by xSiiiLenTx - 02.01.2013, 21:59

Forum Jump:


Users browsing this thread: 2 Guest(s)