My dialog will not open :(
#1

i have a little problem...
Код:
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#define mmx 2179.9241
#define mmy 1449.5735
#define mmz 10.8203
#define mma 212.6368
#define BLUE				0x0000BBAA
#define GREEN				0x33FF33AA

new count = 0;
new mgmg = 0, plcount = 0, inmin[MAX_PLAYERS];

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 1865)
        {
		if(response)
                {
			if(listitem == 0)
			{
				if(mgmg == 0)
				{
                                    SendClientMessageToAll(0xFFFFFF, "I am working fully");
				    SetPlayerPos(playerid, mmx, mmy, mmz);
				    SetPlayerFacingAngle(playerid, mma);
				    if(plcount == 0)
				    {
				           SendClientMessageToAll(BLUE, "Minigun minigame start in 30 sec");
				           SetTimer("MINIGUN", 1000 * 30, 0);
				           SendClientMessage(playerid, GREEN, "You have joined minigun");
				     }
			             if(plcount > 0)
				     {
					    SendClientMessage(playerid, GREEN, "You have joined minigun");
				      }
					    plcount = plcount + 1;
					    inmin[playerid] = 1;
				      }
				      if(mgmg == 1) return SendClientMessage(playerid, GREEN, "You cant join minigame, becourse the game is already started");
			       }
	        }
              	return 1;
	 }
	 return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	SendClientMessageToAll(0xFFFFFF, "OnPlayerDeath works...");
	if(inmin[killerid] == 1)
	{
		if(inmin[playerid] == 1)
		{
		    SendClientMessage(playerid, GREEN, "You are dead now and cant return to the minigame before new game");
		    inmin[playerid] = 0;
		    for(new i = 0; i <MAX_PLAYERS; i++)
			{
			    if(inmin[i] == 1)
			    {
					count = count - 1;
					if(count == 1)
					{
						new Myname[128], str[256];
						GetPlayerName(i, Myname, sizeof(Myname));
						format(str, sizeof(str), "%s have won the minigun minigame", Myname);
					        SendClientMessageToAll(BLUE, str);
					        GivePlayerMoney(i, 100000);
					        mgmg = 0;
					}
				}
			}
		}
	}
	return 1;
}

forward MINIGUN();
public MINIGUN()
{
	mgmg = 1;
	SendClientMessageToAll(BLUE, "MINIGUN minigame have been started");
	for(new i = 0; i <MAX_PLAYERS; i++)
	{
	        if(inmin[i] == 1)
	        {
   			new pname[128], string[256];
			GetPlayerName(i, pname, sizeof(pname));
			format(string, sizeof(string), "%s had joined the the minigame");
			SendClientMessageToAll(GREEN, string);
			count = count + 1;
			
		}
		return 1;
	}
	return 1;
}

CMD:minigame(playerid)
{
    ShowPlayerDialog(playerid, 1865, DIALOG_STYLE_LIST, "MINIGAMES", "minigun\n", "next", "close");
    return 1;
}

CMD:minigun(playerid)
{
	if(mgmg == 0)
	{
		SendClientMessageToAll(0xFFFFFF, "I am working fully");
		SetPlayerPos(playerid, mmx, mmy, mmz);
		SetPlayerFacingAngle(playerid, mma);
		if(plcount == 0)
		{
			SendClientMessageToAll(BLUE, "Minigun minigame start in 30 sec");
			SetTimer("MINIGUN", 1000 * 30, 0);
		        SendClientMessage(playerid, GREEN, "You have joined minigun");
		}
		if(plcount > 0)
		{
	    	SendClientMessage(playerid, GREEN, "You have joined minigun");
		}
		plcount = plcount + 1;
		inmin[playerid] = 1;
	}
	if(mgmg == 1) return SendClientMessage(playerid, GREEN, "You cant join minigame, becourse the game is already started");
	return 1;
}
But for some reason this wont work... i mean my filterscript dont call the OnPlayerDeath and OnDialogResponse. I really dont know why... i just downloaded a new compiler, because i was thinking that that was bugged, but it wasnt that... So what can i do?
Reply
#2

This might help:

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
[...]Q: Command not working / dialog not responding
A: You have a return 1 in OnPlayerCommandText / OnDialogResponse (in some other script) that blocks it. The last return in these callbacks should always be 0 in filterscripts.[...]
Reply
#3

no... it didnt help but ty for helping
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)