Help with this error.
#1

I'm getting this error. ;I
Код:
error 035: argument type mismatch (argument 1)
Heres my whole OnPlayerConnect.
pawn Код:
public OnPlayerConnect(playerid)
{
    if(RoleplayNameCheck(GetPlayerName(playerid)))
    {
        SendClientMessage(playerid, -1, COLOR_RED"Your name is not in the Firstname_Lastname format! "COLOR_WHITE"Please correct it.");
        Kick(playerid);
    }
    return 1;
   
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COLOR_WHITE"Login",""COLOR_WHITE"Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COLOR_WHITE"Registering...",""COLOR_WHITE"Type your password below to register a new account.","Register","Quit");
    }
    return 1;
}
Heres the error line.
pawn Код:
if(! RoleplayNameCheck(GetPlayerName(playerid)))
Another question I wanna ask is; why don't stock and forward turn out blue when I make a function using them? They are just regular black... (I'm REALLY not sure, but I think this can be a bug.)
Reply
#2

You have to store GetPlayerName in a variable like this:
pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name);
Reply
#3

Quote:
Originally Posted by Deathstalker
Посмотреть сообщение
You have to store GetPlayerName in a variable like this:
pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name);
Man I don't wanna sound mega retarded but where am I supposed to put that? Can you add it to my script and explain why? ;I (I'm new to scripting...)
Reply
#4

pawn Код:
public OnPlayerConnect(playerid)
{
    new name[MAX_PLAYER_NAME]; // Create variable to hold name.
    GetPlayerName(playerid, name); // Use GetPlayername to store the player with playerid's name to the variable  above. Then use that variable with your function.
    if(RoleplayNameCheck(name))
    {
        SendClientMessage(playerid, -1, COLOR_RED"Your name is not in the Firstname_Lastname format! "COLOR_WHITE"Please correct it.");
        Kick(playerid);
    }
    return 1;
   
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COLOR_WHITE"Login",""COLOR_WHITE"Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COLOR_WHITE"Registering...",""COLOR_WHITE"Type your password below to register a new account.","Register","Quit");
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by Deathstalker
Посмотреть сообщение
pawn Код:
public OnPlayerConnect(playerid)
{
    new name[MAX_PLAYER_NAME]; // Create variable to hold name.
    GetPlayerName(playerid, name); // Use GetPlayername to store the player with playerid's name to the variable  above. Then use that variable with your function.
    if(RoleplayNameCheck(name))
    {
        SendClientMessage(playerid, -1, COLOR_RED"Your name is not in the Firstname_Lastname format! "COLOR_WHITE"Please correct it.");
        Kick(playerid);
    }
    return 1;
   
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COLOR_WHITE"Login",""COLOR_WHITE"Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COLOR_WHITE"Registering...",""COLOR_WHITE"Type your password below to register a new account.","Register","Quit");
    }
    return 1;
}
Much thanks! It worked. REP +1

EDIT: Anything to my other question? Stock and Forward not appearing blue in pawno! ;I
Reply
#6

i think it should be so,and you will not see this message "Your name is not in....." because kick is fastest than scm

Код:
public OnPlayerConnect(playerid)
{
    new name[MAX_PLAYER_NAME]; // Create variable to hold name.
    GetPlayerName(playerid, name,24); // Use GetPlayername to store the player with playerid's name to the variable  above. Then use that variable with your function. 
    if(RoleplayNameCheck(name))
    {
        SendClientMessage(playerid, -1, COLOR_RED"Your name is not in the Firstname_Lastname format! "COLOR_WHITE"Please correct it.");
        Kick(playerid);
    }
    
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COLOR_WHITE"Login",""COLOR_WHITE"Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COLOR_WHITE"Registering...",""COLOR_WHITE"Type your password below to register a new account.","Register","Quit");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)