SA-MP Forums Archive
The dialog does not appear - 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: The dialog does not appear (/showthread.php?tid=382124)



The dialog does not appear - Jassey - 02.10.2012

I have one more problems with dialogue, when I type the command /lvpd dialog does not appear. Where is the mistake of this:
Код:
CMD:lvpd(playerid, params[])
{
	if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
	{
		if (IsPlayerInRangeOfPoint(playerid,3,244.131195, 190.252990, 1008.171875))
		{
			ShowPlayerDialog(playerid, DIALOG_LVPD, DIALOG_STYLE_LIST, "Loker LVPD","Kerja\nPeralatan\nPakaian", "Pilih", "Batal");
		}
		else
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "Kamu tidak sedang berada dekat dengan Locker LVPD.");
		}
	}
	return 1;
}



Re: The dialog does not appear - trapstar2020 - 02.10.2012

please show on dialog response the entire thing


Re: The dialog does not appear - Jassey - 02.10.2012

Quote:
Originally Posted by trapstar2020
Посмотреть сообщение
please show on dialog response the entire thing
This is the OnDialogResponse
Код:
if(dialogid == DIALOG_LVPD)
	{
	    if(response) return 1;
	    switch(listitem)
	    {
	        case 0:
	        {
	            if(PlayerInfo[playerid][pDuty] == 1)
	            {
					format(string, sizeof(string), "* %s menyimpan badge dan peralatan kerjanya ke Loker.",GetPlayerNameEx(playerid));
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					ResetPlayerWeaponsEx(playerid);
				 	OnDuty[playerid] = 0;
					PlayerInfo[playerid][pDuty] = 0;
					SetPlayerColor(playerid, TEAM_HIT_COLOR);
					SetPlayerArmour(playerid, 0.0);
				}
	            else
	            {
					format(string, sizeof(string), "* %s mengambil badge beserta peralatan kerja di Loker.",GetPlayerNameEx(playerid));
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
     				SetPlayerColor(playerid, COLOR_LVPD);
					SetPlayerArmour(playerid, 100.0);
	   				GivePlayerValidWeapon(playerid, 24, 99999);
					GivePlayerValidWeapon(playerid, 25, 99999);
					GivePlayerValidWeapon(playerid, 3, 99999);
					GivePlayerValidWeapon(playerid, 41, 99999);
				 	OnDuty[playerid] = 1;
					PlayerInfo[playerid][pDuty] = 1;
				}
	        }
	        case 1:
	        {
	            ShowPlayerDialog(playerid, DIALOG_LVPD_WEAPONS, DIALOG_STYLE_LIST, "Peralatan LVPD", "Mace\nStick\nDE\nCombat Shotgun\nMP5\nM4A1\nAK-47\nBomb Asap\nShotgun\nRifle\nSniper\nArmor\nK3\nAksesoris", "Pilih", "Batal");
	        }
	        case 2:
	        {
	            ShowPlayerDialog(playerid, DIALOG_LVPD_CLOTHING, DIALOG_STYLE_LIST, "Pakaian", "Seragam\nPakaian untuk istirahat", "Pilih", "Batal");
	        }
	    }
	}
	if(dialogid == DIALOG_LVPD_WEAPONS)
	{
 		if(response)
		{
		    if(Tax <= 0) return SendClientMessageEx(playerid,COLOR_WHITE,"Pemerintahan sedang memiliki tunggakan; tidak ada dana untuk peralatan.");
			if(PlayerInfo[playerid][pConnectTime] < 2 || PlayerInfo[playerid][pWRestricted] > 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "Kamu memiliki pembatasan senjata, jadi kamu belum dapat menggunakan senjata!");
			if(listitem == 0) // Mace
			{
				GivePlayerValidWeapon(playerid, 41, 60000);
				Tax -= 20;
			}
			else if(listitem == 1) // Nite Stick
			{
				GivePlayerValidWeapon(playerid, 3, 60000);
				Tax -= 20;
			}
			else if(listitem == 2) //  Deagle
			{
				GivePlayerValidWeapon(playerid, 24, 60000);
				Tax -= 500;
			}
			else if(listitem == 3) // Spas12 *
			{
				GivePlayerValidWeapon(playerid, 27, 60000);
				Tax -= 10000;
			}
			else if(listitem == 4) //  mp5
			{
				GivePlayerValidWeapon(playerid, 29, 60000);
				Tax -= 400;
			}
			else if(listitem == 5) //  m4 *
			{
				GivePlayerValidWeapon(playerid, 31, 60000);
				Tax -= 4000;
			}
			else if(listitem == 6) //  ak-47 *
			{
				GivePlayerValidWeapon(playerid, 30, 60000);
				Tax -= 4000;
			}
			else if(listitem == 7) //  Smoke Bomb *
			{
				GivePlayerValidWeapon(playerid, 17, 5);
				Tax -= 800;
			}
			else if(listitem == 8) //  Shotgun
			{
				GivePlayerValidWeapon(playerid, 25, 60000);
                Tax -= 200;
			}
			else if(listitem == 9) // rifle
			{
				GivePlayerValidWeapon(playerid, 33, 60000);
				Tax -= 1000;
			}
			else if(listitem == 10) // Sniper *
			{
				GivePlayerValidWeapon(playerid, 34, 60000);
				Tax -= 10000;
			}
			else if(listitem == 11) // LSPD Kevlar
			{
				SetPlayerArmour(playerid, 100.0);
				Tax -= 2000;
			}
			else if(listitem == 12) SetPlayerHealth(playerid, 100);
			else ShowPlayerDialog( playerid, BUYTOYSCOP, DIALOG_STYLE_MSGBOX, "Aksesoris", "Selamat datang di Locker Aksesoris LEO!\n\n(Sama dengan aksesoris biasa, VIP membuka lebih banyak slot.)","Lanjut", "Batal" );

		}
	}
	if(dialogid == DIALOG_LVPD_CLOTHING)
	{
	    switch(listitem)
	    {
	        case 0: 
			{
				ShowPlayerDialog(playerid, DIALOG_LVPD_CLOTHING_TWO, DIALOG_STYLE_LIST, "Seragam","Cadet\nPolwan\nOfficer\nKopral\nSersan\nLetnan\nPolantas\nSWAT\nKapten\nJendral", "Pakai", "Batal");
			}
			case 1:
			{
				ShowPlayerDialog(playerid, FDUTYMENU4, DIALOG_STYLE_INPUT, "Pakaian","Pilih pakaian (dengan ID).", "Pilih", "Batal");
			}
		}
	}
	if(dialogid == DIALOG_LVPD_CLOTHING_TWO)
	{
	    switch(listitem)
	    {
	        case 0:
	        {
				if(PlayerInfo[playerid][pRank] >= 0)
			    {
					PlayerInfo[playerid][pModel] = 71; // Cadet
					SetPlayerSkin(playerid, 71);
				}
				else
				{
					SendClientMessageEx(playerid, COLOR_WHITE, "Minimal pangkat Cadet untuk dapat menggunakan seragam itu.");
				}
	        }
	        case 1:
	        {
				if(PlayerInfo[playerid][pSex] == 2)
			    {
					PlayerInfo[playerid][pModel] = 141; // Polwan
					SetPlayerSkin(playerid, 141);
				}
				else
				{
				    SendClientMessageEx(playerid, COLOR_WHITE, "Kamu bukan seorang wanita.");
				}
	        }
	        case 2:
	        {
				if(PlayerInfo[playerid][pRank] >= 1)
			    {
					PlayerInfo[playerid][pModel] = 282; // Officer
					SetPlayerSkin(playerid, 282);
				}
				else
				{
					SendClientMessageEx(playerid, COLOR_WHITE, "Minimal pangkat Officer untuk dapat menggunakan seragam itu.");
				}
	        }
	        case 3:
	        {
				if(PlayerInfo[playerid][pRank] >= 2)
			    {
					PlayerInfo[playerid][pModel] = 280; // Kopral
					SetPlayerSkin(playerid, 280);
				}
				else
				{
					SendClientMessageEx(playerid, COLOR_WHITE, "Minimal pangkat Kopral untuk dapat menggunakan seragam itu.");
				}
	        }
	        case 4:
	        {
				if(PlayerInfo[playerid][pRank] >= 3)
			    {
					PlayerInfo[playerid][pModel] = 266; // Sersan
					SetPlayerSkin(playerid, 266);
				}
				else
				{
					SendClientMessageEx(playerid, COLOR_WHITE, "Minimal pangkat Sersan untuk dapat menggunakan seragam itu.");
				}
	        }
	        case 5:
	        {
				if(PlayerInfo[playerid][pRank] >= 4)
			    {
					PlayerInfo[playerid][pModel] = 281; // Letnan
					SetPlayerSkin(playerid, 281);
				}
				else
				{
					SendClientMessageEx(playerid, COLOR_WHITE, "Minimal pangkat Letnan untuk dapat menggunakan seragam itu.");
				}
	        }
	        case 6:
	        {
				PlayerInfo[playerid][pModel] = 284; // Polantas
				SetPlayerSkin(playerid, 284);
	        }
	        case 7:
			{
				if(PlayerInfo[playerid][pDivision] == 2)
			    {
					SetPlayerSkin(playerid, 285); // SWAT
					PlayerInfo[playerid][pModel] = 285;
				}
				else
				{
				    SendClientMessageEx(playerid, COLOR_WHITE, "Hanya divisi SWAT yang dapat menggunakan seragam itu.");
				}
			}
	        case 8:
	        {
				if(PlayerInfo[playerid][pRank] >= 5)
			    {
					PlayerInfo[playerid][pModel] = 265; // Kapten
					SetPlayerSkin(playerid, 265);
				}
				else
				{
				    SendClientMessageEx(playerid, COLOR_WHITE, "Minimal pangkat Kapten untuk dapat menggunakan seragam itu.");
				}
	        }
	        case 9:
	        {
				if(PlayerInfo[playerid][pRank] >= 6)
			    {
					PlayerInfo[playerid][pModel] = 267; // Jendral
					SetPlayerSkin(playerid, 267);
				}
				else
				{
				    SendClientMessageEx(playerid, COLOR_WHITE, "Hanya Jendral yang dapat menggunakan seragam itu.");
				}
	        }	        
	    }
	}



Re: The dialog does not appear - trapstar2020 - 02.10.2012

u need to end on dialog response with return 0; and u need to end the dialog with return 1;


Re: The dialog does not appear - Jarnu - 02.10.2012

if (IsPlayerInRangeOfPoint(playerid,3,244.131195, 190.252990, 1008.171875))

This means player must be sticked with the range.. means AT EXACT Pos.. not in range.. because '3' is damn less range.
change it to atleast 15.0 to 30.0
Ex:
pawn Код:
if (IsPlayerInRangeOfPoint(playerid,20.0,244.131195, 190.252990, 1008.171875))
it must work.


Re: The dialog does not appear - XtremeR - 02.10.2012

if its not working open your all FS and GM and Search for OnDialogRepsonse and Add this

pawn Код:
return 0;



Re: The dialog does not appear - RedJohn - 02.10.2012

pawn Код:
CMD:lvpd(playerid, params[])
{
    if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
    {
        if (IsPlayerInRangeOfPoint(playerid, 10.0, 244.131195, 190.252990, 1008.171875))
        {
            ShowPlayerDialog(playerid, DIALOG_LVPD, DIALOG_STYLE_LIST, "Loker LVPD","Kerja\nPeralatan\nPakaian", "Pilih", "Batal");
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_WHITE, "Kamu tidak sedang berada dekat dengan Locker LVPD.");
        }
    }
    return 1;
}
pawn Код:
if(dialogid == DIALOG_LVPD)
{
    if(response)
    {
        switch(listitem)
        {
            case 0:
            {
                if(PlayerInfo[playerid][pDuty] == 1)
                {
                    format(string, sizeof(string), "* %s menyimpan badge dan peralatan kerjanya ke Loker.",GetPlayerNameEx(playerid));
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    ResetPlayerWeaponsEx(playerid);
                    OnDuty[playerid] = 0;
                    PlayerInfo[playerid][pDuty] = 0;
                    SetPlayerColor(playerid, TEAM_HIT_COLOR);
                    SetPlayerArmour(playerid, 0.0);
                }
                else
                {
                    format(string, sizeof(string), "* %s mengambil badge beserta peralatan kerja di Loker.",GetPlayerNameEx(playerid));
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    SetPlayerColor(playerid, COLOR_LVPD);
                    SetPlayerArmour(playerid, 100.0);
                    GivePlayerValidWeapon(playerid, 24, 99999);
                    GivePlayerValidWeapon(playerid, 25, 99999);
                    GivePlayerValidWeapon(playerid, 3, 99999);
                    GivePlayerValidWeapon(playerid, 41, 99999);
                    OnDuty[playerid] = 1;
                    PlayerInfo[playerid][pDuty] = 1;
                }
            }
            case 1:
            {
                ShowPlayerDialog(playerid, DIALOG_LVPD_WEAPONS, DIALOG_STYLE_LIST, "Peralatan LVPD", "Mace\nStick\nDE\nCombat Shotgun\nMP5\nM4A1\nAK-47\nBomb Asap\nShotgun\nRifle\nSniper\nArmor\nK3\nAksesoris", "Pilih", "Batal");
            }
            case 2:
            {
                ShowPlayerDialog(playerid, DIALOG_LVPD_CLOTHING, DIALOG_STYLE_LIST, "Pakaian", "Seragam\nPakaian untuk istirahat", "Pilih", "Batal");
            }
        }
    }
}