OnPlayerConnect [HELP]
#1

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?
Reply
#2

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);
        }
        }
}
Reply
#3

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.
Reply
#4

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

Thank You Guy's.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)