02.01.2013, 21:52
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:
It only happens when adding this code:
To this:
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.
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;
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;
}