OnDialogResponse don't work
#1

I Made this script of elevator, but it don't work, because?
Код:
#include <a_samp>
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
new ascensore;


public OnFilterScriptInit()
{
   	ascensore = CreateObject(2669, 1264.69, -1242.66, 16.83,   0.00, 0.00, 0.00);
   	Create3DTextLabel( "Premi Y per usare l'ascensore" ,-1, 1265.4659, -1244.7430, 16.5900 , 50,0,0 );
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if (newkeys & KEY_YES)
	{
		if(IsPlayerInRangeOfPoint(playerid, 7.0, 1265.5850, -1244.6940, 16.5900))
        {
		ShowPlayerDialog(playerid,DIALOG_ASCENSORE,DIALOG_STYLE_LIST,"Ascensore Cantiere","Piano Terra\n1°Piano\n2° Piano\n3° Piano\n4° Piano\n5° Piano","Conferma","Chiudi");
        }
		else if(IsPlayerInRangeOfPoint(playerid,2.0, 1265.5850, -1244.6940, 20.4169))
        {
        ShowPlayerDialog(playerid,DIALOG_ASCENSORE,DIALOG_STYLE_LIST,"Ascensore Cantiere","Piano Terra\n1°Piano\n2° Piano\n3° Piano\n4° Piano\n5° Piano","Conferma","Chiudi");
  		}
  		else if(IsPlayerInRangeOfPoint(playerid,2.0, 1265.5850, -1244.6940, 25.4298))
        {
        ShowPlayerDialog(playerid,DIALOG_ASCENSORE,DIALOG_STYLE_LIST,"Ascensore Cantiere","Piano Terra\n1°Piano\n2° Piano\n3° Piano\n4° Piano\n5° Piano","Conferma","Chiudi");
  		}
  		else if(IsPlayerInRangeOfPoint(playerid,2.0, 1265.5850, -1244.6940, 30.4177))
        {
        ShowPlayerDialog(playerid,DIALOG_ASCENSORE,DIALOG_STYLE_LIST,"Ascensore Cantiere","Piano Terra\n1°Piano\n2° Piano\n3° Piano\n4° Piano\n5° Piano","Conferma","Chiudi");
  		}
  		else if(IsPlayerInRangeOfPoint(playerid,2.0, 1265.5850, -1244.6940, 35.4341))
        {
		ShowPlayerDialog(playerid,DIALOG_ASCENSORE,DIALOG_STYLE_LIST,"Ascensore Cantiere","Piano Terra\n1°Piano\n2° Piano\n3° Piano\n4° Piano\n5° Piano","Conferma","Chiudi");
        }
		else if(IsPlayerInRangeOfPoint(playerid,2.0, 1265.5850, -1244.6940, 40.4335))
        {
        ShowPlayerDialog(playerid,DIALOG_ASCENSORE,DIALOG_STYLE_LIST,"Ascensore Cantiere","Piano Terra\n1°Piano\n2° Piano\n3° Piano\n4° Piano\n5° Piano","Conferma","Chiudi");
  		}
	}
	return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == DIALOG_ASCENSORE)
	{
	   if(response)
	   {
			 switch(listitem)
			 {
				   case 0: MoveObject(ascensore, 1264.69, -1242.66, 16.83,4);
				   case 1: MoveObject(ascensore, 1264.6904, -1242.6641, 20.6673,4);
				   case 2: MoveObject(ascensore, 1264.6904, -1242.6641, 25.6552,4);
				   case 3: MoveObject(ascensore, 1264.6904, -1242.6641, 30.6637,4);
				   case 4: MoveObject(ascensore, 1264.6904, -1242.6641, 35.6656,4);
				   case 5: MoveObject(ascensore, 1264.6904, -1242.6641, 40.6715,4);
			 }
	   }
    }
	return 1;
}
Reply


Messages In This Thread
OnDialogResponse don't work - by Gianmarco - 11.11.2013, 16:56
Re: OnDialogResponse don't work - by -=Dar[K]Lord=- - 11.11.2013, 17:05

Forum Jump:


Users browsing this thread: 1 Guest(s)