SA-MP Forums Archive
Help On Dialog - 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: Help On Dialog (/showthread.php?tid=572099)



Help On Dialog - Driver546465 - 25.04.2015

I want To Make AnyOne Join Server if he registered a dialog come and tell him login not use /login cmd

help!!!!!!!!! and thanks


Re: Help On Dialog - AaronFarley - 25.04.2015

Simply create a dialog under "OnPlayerConnect" but depending on what login & Register system you use will depend on the code.

Example of MYSQL Login/Register from my script:
pawn Код:
public OnPlayerConnect(playerid)
{
    new query[200],pname[24];
    GetPlayerName(playerid,pname,MAX_PLAYER_NAME);

    format(query,sizeof(query),"SELECT UserID FROM Users WHERE Name='%s' LIMIT 1",pname);
    mysql_query(query);
    mysql_store_result();
    if(mysql_num_rows() != 0)
    {
        ShowPlayerDialog(playerid,1, DIALOG_STYLE_PASSWORD, "{ffaa00}Server Name Login", "{ffffff}Welcome Back To Server Name \n\nPlease Log In. If This Is Not Your Account Please {ff0000}/quit{ffffff}\nAnd Join With A Different name", "Login", "Cancel"); //Shows our login dialog :)
    }
    else
    {
        ShowPlayerDialog(playerid,2 ,DIALOG_STYLE_INPUT,"{ffaa00}Server Name Registration","{ffffff}Welcome To {FFAA00}Server Name  \n\n{ffffff}To Play Here You Must Create An Account.","Register","Cancel");
    }
    mysql_free_result();

    return 1;
}

I highly suggest the use of MySQL but it's up to you. All you need to worry about is adding the dialogs if you know what you are doing. If you dont know how to modify the script to allow dialog registering I suggest you follow some of the great tutorials created by the kind members of the community.


Re: Help On Dialog - Driver546465 - 25.04.2015

Mine Dini


Re: Help On Dialog - AaronFarley - 25.04.2015

Right, gimme one sec and I'll see what I can do for you.

Edit: This tutorial should be of much use as it goes into some detail

https://sampforum.blast.hk/showthread.php?pid=1183891#pid1183891

But if you have the time, learn some MySql its pretty fast but takes some time to learn properly


Re: Help On Dialog - Driver546465 - 25.04.2015

ok im waiting