SA-MP Forums Archive
Rules after Register! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Rules after Register! (/showthread.php?tid=460618)



Rules after Register! - DJRebis - 29.08.2013

Hi, me again now im trying to make like when player register then it shows rules dialog but if player ragistred then rule dialog doesn't show up! (Only for new players)
I dunno how to make that! If there is any tutorial teh pls link me
Код:
public OnPlayerConnect(playerid)
{
	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;
}
But how to add after register this:
Код:
ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX,"Rules","My rules","Accept","Ignore");



Re: Rules after Register! - Misiur - 29.08.2013

In OnDialogResponse you should have something like if dialogid == dregister - if the registration is completed, show the rules dialog.