SA-MP Forums Archive
OnPlayerConnect [HELP] - 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: OnPlayerConnect [HELP] (/showthread.php?tid=312946)



OnPlayerConnect [HELP] - Sting. - 23.01.2012

I want a ShowPlayerDialog thing coming up when OnPlayerConnect, saying the rules. Now about the dialog response, for accept, he continues to the OnPlayerRequestClass. Now how to do when player chooses disagree, he get's kicked... how do I do that?


Re: OnPlayerConnect [HELP] - viper_viper - 23.01.2012

pawn Код:
public OnPlayerConnect(playerid)
{
    ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"The Rules","(enter your rules here)","Accept","Decline");
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if (dialogid == 0)
    {
        if (response == 0)
        {
            SendClientMessage(playerid,0xFF0000AA,"You must agree to our rules to play on this server");
                        Kick(playerid);
        }
        }
}



Re: OnPlayerConnect [HELP] - lordturhan - 23.01.2012

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

#define DIALOG_RULES 350

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif

public OnPlayerConnect(playerid)
{
    ShowPlayerDialog(playerid,DIALOG_RULES,DIALOG_STYLE_MSGBOX,"Rules","YOUR RULES HERE","Accept","Deny");
    return 1;
}



public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_RULES)
    {
        if(!response) return Kick(playerid);
        return 1;
    }
    return 0;
}
Noteont know if it works.


Re: OnPlayerConnect [HELP] - MAVERICKS - 23.01.2012

here you are my friend:
https://sampwiki.blast.hk/wiki/ShowPlayerDialog


Re: OnPlayerConnect [HELP] - Sting. - 23.01.2012

Thank You Guy's.