error 035: argument type mismatch (argument 1)
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;
}
if(! RoleplayNameCheck(GetPlayerName(playerid)))
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name);
You have to store GetPlayerName in a variable like this:
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;
}
pawn Код:
|
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; }