PDA

View Full Version : Help Needed


semaj
10/06/2013, 11:44 PM
stuck on how to add this into my GM

public OnPlayerConnect(playerid)
{//you will need to put the fexist to check if the player have registered before this
new INI:File = INI_Open(UserPath(playerid));//and put the shit below when the dialog shows instead checking a something that does not exist
if(PlayerInfo[playerid][pBanned] == 1) return Ban(playerid); //now he's REALLY banned!
else
{
//show your login dialog
}
return 1;
}

My GM
public OnPlayerConnect(playerid)
{
if( fexist ( user_account_path ( playerid ) ) )
{
INI_ParseFile(user_account_path ( playerid ), "load_user_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Welcome.Please log-in",""COLOR_WHITE"Type your "COLOR_GREEN"password "COLOR_WHITE"here to log-in", #Log-in, #Quit);
}

else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Please register!",""COLOR_WHITE"Type your "COLOR_GREEN"password "COLOR_WHITE"here to register.", #Register, #Quit);
}
userData[ playerid ][ Admin_Level ] = 0;
userData[ playerid ][ Money ] = 0;
userData[ playerid ][ Deaths ] = 0;
userData[ playerid ][ Score ] = 0;
return 1;
}

Can anyone help?

whando
11/06/2013, 01:07 AM
Not sure because I don't use that but..


public OnPlayerConnect(playerid)
{//you will need to put the fexist to check if the player have registered before this
new INI:File = INI_Open(UserPath(playerid));//and put the shit below when the dialog shows instead checking a something that does not exist
if(PlayerInfo[playerid][pBanned] == 1) return Ban(playerid); //now he's REALLY banned!
else
{
if( fexist ( user_account_path ( playerid ) ) )
{
INI_ParseFile(user_account_path ( playerid ), "load_user_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Welcome.Please log-in",""COLOR_WHITE"Type your "COLOR_GREEN"password "COLOR_WHITE"here to log-in", #Log-in, #Quit);
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Please register!",""COLOR_WHITE"Type your "COLOR_GREEN"password "COLOR_WHITE"here to register.", #Register, #Quit);
}
userData[ playerid ][ Admin_Level ] = 0;
userData[ playerid ][ Money ] = 0;
userData[ playerid ][ Deaths ] = 0;
userData[ playerid ][ Score ] = 0;
}
return 1;
}

NeoPro
11/06/2013, 01:11 AM
public OnPlayerConnect(playerid)
{//you will need to put the fexist to check if the player have registered before this
new INI:File = INI_Open(UserPath(playerid));//and put the shit below when the dialog shows instead checking a something that does not exist
if(PlayerInfo[playerid][pBanned] == 1) return Ban(playerid); //now he's REALLY banned!
else
{
if( fexist ( user_account_path ( playerid ) ) )
{
INI_ParseFile(user_account_path ( playerid ), "load_user_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Welcome.Please log-in",""COLOR_WHITE"Type your "COLOR_GREEN"password "COLOR_WHITE"here to log-in", #Log-in, #Quit);
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Please register!",""COLOR_WHITE"Type your "COLOR_GREEN"password "COLOR_WHITE"here to register.", #Register, #Quit);
}
userData[ playerid ][ Admin_Level ] = 0;
userData[ playerid ][ Money ] = 0;
userData[ playerid ][ Deaths ] = 0;
userData[ playerid ][ Score ] = 0;
}
return 1;
}

Late!