SA-MP Forums Archive
ShowPlayerDialog !! ( rep +1 ) - 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: ShowPlayerDialog !! ( rep +1 ) (/showthread.php?tid=347519)



ShowPlayerDialog !! ( rep +1 ) - Avi57 - 02.06.2012

Hey Guys, I Created this FS But when i click Accept Nothinh Happens and When i click Decline Nothing Happens.I Want that when Someone Click Accept it Should Say : Thank for Accepting Rules !
and When Decline, It Should Say : Never Decline Our Rules ! Enjoy a kick ! and then Player Gets Kick !

Heres Code :
Код:
//RuleS diALOG
#include <a_samp>

#pragma tabsize 0

#define DIALOG_RULES 2

#if defined FILTERSCRIPT


public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	
	
#else

#endif

	public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/rules", cmdtext, true, 10) == 0)
	{
		ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_MSGBOX, "Rules", "1.Do Not Ask for Admin, It Decreases Your Chances.\n2.Do not Spawnkill, it Can get you to Ban.\n3.Do not Abuse any Bug, It Can cause you Temp-Ban.\n4.Do not Advertise any Server Here\n5.Last, Enjoy here !", "Accept", "Decline");
		return 1;
	}
	return 0;
}
	
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
    {
    switch(2)
        {
		case 1:
    	    {
           	switch(listitem)
        	{
        	    case 0:
        	    {
                    SendClientMessage(playerid, 0xFF0000FF, "Thank for Accepting Rules !");
                }
                case 1:
                {
                    Kick(playerid);
                }
             }
    	    }
	}
    }
    return 1;
}
tHANKS !


Re: ShowPlayerDialog !! ( rep +1 ) - tyler12 - 02.06.2012

when you click the first item it sends the message
when you click the second item it kicks you
pawn Код:
if(response)
            {
                SendClientMessage(playerid, COLOR, "You accepted the rules");
                return 1;
            }
else if(!response)
            {
                Kick(playerid)
                return 1;
            }



Re: ShowPlayerDialog !! ( rep +1 ) - Avi57 - 02.06.2012

Can u put that in FS ? Not able to manage it saying errors
THanks


Re: ShowPlayerDialog !! ( rep +1 ) - tyler12 - 02.06.2012

pawn Код:
#include <a_samp>

#pragma tabsize 0

#define DIALOG_RULES 2

#if defined FILTERSCRIPT

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

#else
#endif

    public OnPlayerCommandText(playerid, cmdtext[]) {
        if (strcmp("/rules", cmdtext, true, 10) == 0) {
            ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_MSGBOX, "Rules", "1.Do Not Ask for Admin, It Decreases Your Chances.\n2.Do not Spawnkill, it Can get you to Ban.\n3.Do not Abuse any Bug, It Can cause you Temp-Ban.\n4.Do not Advertise any Server Here\n5.Last, Enjoy here !", "Accept", "Decline");
            return 1;
        }
        return 0;
    }

    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
        if(response) {
            switch(2) {
                case 1:
                {
                    if(response) {
                        SendClientMessage(playerid, -1, "You accepted the rules");
                        return 1;
                    }
                    else if(!response) {
                        Kick(playerid);
                        return 1;
                    }
                    switch(listitem) {
                        case 0:
                        {
                        }
                        case 1:
                        {
                        }
                    }
                }
            }
        }
        return 1;
    }



Re: ShowPlayerDialog !! ( rep +1 ) - Gangs_Rocks - 02.06.2012

tyler, why don't you use

switch(response)
case 0:
case 1:

Or is it wrong?


Re: ShowPlayerDialog !! ( rep +1 ) - Avi57 - 02.06.2012

Quote:
Originally Posted by tyler12
Посмотреть сообщение
pawn Код:
#include <a_samp>

#pragma tabsize 0

#define DIALOG_RULES 2

#if defined FILTERSCRIPT

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

#else
#endif

    public OnPlayerCommandText(playerid, cmdtext[]) {
        if (strcmp("/rules", cmdtext, true, 10) == 0) {
            ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_MSGBOX, "Rules", "1.Do Not Ask for Admin, It Decreases Your Chances.\n2.Do not Spawnkill, it Can get you to Ban.\n3.Do not Abuse any Bug, It Can cause you Temp-Ban.\n4.Do not Advertise any Server Here\n5.Last, Enjoy here !", "Accept", "Decline");
            return 1;
        }
        return 0;
    }

    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
        if(response) {
            switch(2) {
                case 1:
                {
                    if(response) {
                        SendClientMessage(playerid, -1, "You accepted the rules");
                        return 1;
                    }
                    else if(!response) {
                        Kick(playerid);
                        return 1;
                    }
                    switch(listitem) {
                        case 0:
                        {
                        }
                        case 1:
                        {
                        }
                    }
                }
            }
        }
        return 1;
    }
Still Not worked


Re: ShowPlayerDialog !! ( rep +1 ) - Gangs_Rocks - 02.06.2012

pawn Код:
#include <a_samp>

#pragma tabsize 0

#define DIALOG_RULES 2

#if defined FILTERSCRIPT

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

#else
#endif

    public OnPlayerCommandText(playerid, cmdtext[]) {
        if (strcmp("/rules", cmdtext, true, 10) == 0) {
            ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_MSGBOX, "Rules", "1.Do Not Ask for Admin, It Decreases Your Chances.\n2.Do not Spawnkill, it Can get you to Ban.\n3.Do not Abuse any Bug, It Can cause you Temp-Ban.\n4.Do not Advertise any Server Here\n5.Last, Enjoy here !", "Accept", "Decline");
            return 1;
        }
        return 0;
    }

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_RULES:
        {
            switch(response)
            {
                case 0: return SendClientMessage(playerid, -1, "You accepted the rules");
                case 1: return Kick(playerid);
            }
        }
    }
    return 1;
}
Try this.


Re: ShowPlayerDialog !! ( rep +1 ) - Niko_boy - 02.06.2012

Nothing will work -_-
u have to
Код:
return 0;
in Differnt scripts if u have more than once including Gamemode + FS
Quote:

return 0; // If you put return 1 here the callback will not continue to be called in other scripts (filterscripts, etc.).

https://sampwiki.blast.hk/wiki/OnDialogResponse
Just read once
So
Код:
return 0;
instead of
Код:
return 1;
in
Код:
OnPlayerDialogResponse



Re: ShowPlayerDialog !! ( rep +1 ) - Gangs_Rocks - 02.06.2012

Niko, it still didn't work somehow. Tried my code and did return 0; BUT still it didn't work. The dialog shows but doesn't respond.


Re: ShowPlayerDialog !! ( rep +1 ) - MadeMan - 02.06.2012

Remove all other filterscripts and try then.