SA-MP Forums Archive
dialog problem. - 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: dialog problem. (/showthread.php?tid=580884)



dialog problem. - SpikeSpigel - 09.07.2015

Hi there, I have a /v mod command that let's you tune your vehicle if you are in the LSAS faction. But there's one little problem-.. it's just not working. This is the command:

pawn Код:
else if(strcmp(x_vehicle, "mod", true) == 0)
            {
                new vehicleid = GetPlayerVehicleID(playerid);
                if(vehicleid <= IBPCARS)
                {
                    return 1;
                }
                if(IsPlayerInRangeOfPoint(playerid, 20, 2531.6143, -1555.6794, 25.1923) || IsPlayerInRangeOfPoint(playerid, 20, 2530.6426, -1547.0442, 25.1923) || IsPlayerInRangeOfPoint(playerid, 20, 2530.3752, -1539.2592, 25.1923) || IsPlayerInRangeOfPoint(playerid, 20, 2530.1902, -1531.5018, 25.1923) || IsPlayerInRangeOfPoint(playerid, 20, 2530.0493, -1524.3677, 24.5870))
                {
                    {
                        new plname[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, plname, sizeof(plname));
                        if(PlayerInfo[playerid][pFaction] == 7)
                        {
                            ShowPlayerDialog(playerid, Vmod, DIALOG_STYLE_LIST, "Modificarile Masinii", "Reparatie\nRoti\nPaintJob\nHydraulice\nTunning avansat\nSpoiler\nRemove tunning", "Select", "Cancel");
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GRAD2, "Nu esti membru LSAS.");
                            return 1;
                        }
                    }
                    SendClientMessage(playerid, COLOR_GRAD2, "Nu esti la sediu.");
                    return 1;
                }
                return 1;
            }
The dialog ID is : 623.

And that's the dialogresponse:

pawn Код:
if(dialogid == Vmod) // dialogid == Vmod - default one
    {
        if(response)
        {
            if(listitem == 0) //Repair Engine
            {
                SetVehicleHealth(GetPlayerVehicleID(playerid), 1000);
                RepairVehicle(vehicleid);
                GivePlayerCash(playerid,-150);
                return 1;
            }
            if(listitem == 1) // Wheels
            {
                ShowPlayerDialog(playerid, Vmod3, DIALOG_STYLE_LIST, "Rims(35$)","Shadow\r\nMega\r\nRimshine\r\nWires\r\nClassic\r\nTwist\r\nCutter\r\nSwitch\r\nGrove\r\nImport\nDollar\r\nTrance\r\nAtomic\r\nAhab\r\nVirtual", "Buy", "Cancel");
            }
            if(listitem == 2) // PaintJobs
            {
                ShowPlayerDialog(playerid,  Vmod4, DIALOG_STYLE_LIST, "PaintJobs(25$)","PaintJob1\nPaintJob2\nPaintJob3", "Install", "Cancel");
            }
            if(listitem == 3) // Hydraulics
            {
                ShowPlayerDialog(playerid,  Vmod6, DIALOG_STYLE_LIST, "Hydraulics(150$)","Hydraulics", "Upgrade", "Cancel");
            }
            if(listitem == 4) // Exotic Vehicle modding
            {
                if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 558)
                {
                    ShowPlayerDialog(playerid,  Vmod8, DIALOG_STYLE_LIST, "Uranus Modifications","Alien Roof\nAlien Exhaust\nAlien Sideskirt\nAlien Spoiler\nAlien Front Bumper\nAlien Rear Bumper\nXflow Roof\nXflow Exhaust\nXflow Sideskirt\nXflow Spoiler\nXflow Front Bumper\nXflow Rear Bumper", "Upgrade", "Cancel");
                }
                else if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 559)
                {
                    ShowPlayerDialog(playerid,  Vmod10, DIALOG_STYLE_LIST, "Jester Modifications","Alien Roof\nAlien Exhaust\nAlien Sideskirt\nAlien Spoiler\nAlien Front Bumper\nAlien Rear Bumper\nXflow Roof\nXflow Exhaust\nXflow Sideskirt\nXflow Spoiler\nXflow Front Bumper\nXflow Rear Bumper", "Upgrade", "Cancel");
                }
                else if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 560)
                {
                    ShowPlayerDialog(playerid,  Vmod9, DIALOG_STYLE_LIST, "Sultan Modifications","Alien Roof\nAlien Exhaust\nAlien Sideskirt\nAlien Spoiler\nAlien Front Bumper\nAlien Rear Bumper\nXflow Roof\nXflow Exhaust\nXflow Sideskirt\nXflow Spoiler\nXflow Front Bumper\nXflow Rear Bumper", "Upgrade", "Cancel");
                }
                else if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 562)
                {
                    ShowPlayerDialog(playerid,  Vmod11, DIALOG_STYLE_LIST, "Elegy Modifications","Alien Roof\nAlien Exhaust\nAlien Sideskirt\nAlien Spoiler\nAlien Front Bumper\nAlien Rear Bumper\nXflow Roof\nXflow Exhaust\nXflow Sideskirt\nXflow Spoiler\nXflow Front Bumper\nXflow Rear Bumper", "Upgrade", "Cancel");
                }
                        }
            if(listitem == 5)
            {
                ShowPlayerDialog(playerid,  500, DIALOG_STYLE_LIST, "Spoiler","Win\nFury\nAlpha\nPro\nRace\nDrag\n", "Instaleaza", "Refuza");
            }
            if(listitem == 6) //REMOVE TUNNING
            {
                ShowPlayerDialog(playerid,  Vmod2, DIALOG_STYLE_LIST, "Remove Tunning","Wheels\nHydraulics\nRoof\nExhaust\nSideskirt\nSpoiler\nFront Bumper\nRear Bumper\nRestu", "Upgrade", "Cancel");
            }
        }
        return 1;
    }
Hmm-.. I don't know why it gets soo F'd up-.. In my script is looking so ok .


Re: dialog problem. - Lorenc_ - 09.07.2015

What is exactly not working? The command? The dialog is not showing but the command works?


Re: dialog problem. - SpikeSpigel - 09.07.2015

Hmm, normally if I'm not at the position it have to sya to me that I'm not in the right position-.. That's not working to. THe same if I'm not on LSAS-.. It should say to me that but doesn't . Annd-.. The dialog doesn't show up . It worked ONLY one time-.. but for like 30 seconds.


Re: dialog problem. - TonyVk - 09.07.2015

You have two open brackets under IsPlayerInRangeOfPoint

Код:
else if(strcmp(x_vehicle, "mod", true) == 0)
			{
			    new vehicleid = GetPlayerVehicleID(playerid);
				if(vehicleid <= IBPCARS)
				{
					return 1;
				}
                if(IsPlayerInRangeOfPoint(playerid, 20, 2531.6143, -1555.6794, 25.1923) || IsPlayerInRangeOfPoint(playerid, 20, 2530.6426, -1547.0442, 25.1923) || IsPlayerInRangeOfPoint(playerid, 20, 2530.3752, -1539.2592, 25.1923) || IsPlayerInRangeOfPoint(playerid, 20, 2530.1902, -1531.5018, 25.1923) || IsPlayerInRangeOfPoint(playerid, 20, 2530.0493, -1524.3677, 24.5870))
                {
						new plname[MAX_PLAYER_NAME];
						GetPlayerName(playerid, plname, sizeof(plname));
		    			if(PlayerInfo[playerid][pFaction] == 7)
					    {
						   	ShowPlayerDialog(playerid, Vmod, DIALOG_STYLE_LIST, "Modificarile Masinii", "Reparatie\nRoti\nPaintJob\nHydraulice\nTunning avansat\nSpoiler\nRemove tunning", "Select", "Cancel");
						}
						else
						{
							SendClientMessage(playerid, COLOR_GRAD2, "Nu esti membru LSAS.");
							return 1;
		            	}
					SendClientMessage(playerid, COLOR_GRAD2, "Nu esti la sediu.");
					return 1;
				}
				return 1;
			}



Re: dialog problem. - SpikeSpigel - 09.07.2015

Quote:
Originally Posted by TonyVk
Посмотреть сообщение
You have two open brackets under IsPlayerInRangeOfPoint

Код:
else if(strcmp(x_vehicle, "mod", true) == 0)
			{
			    new vehicleid = GetPlayerVehicleID(playerid);
				if(vehicleid <= IBPCARS)
				{
					return 1;
				}
                if(IsPlayerInRangeOfPoint(playerid, 20, 2531.6143, -1555.6794, 25.1923) || IsPlayerInRangeOfPoint(playerid, 20, 2530.6426, -1547.0442, 25.1923) || IsPlayerInRangeOfPoint(playerid, 20, 2530.3752, -1539.2592, 25.1923) || IsPlayerInRangeOfPoint(playerid, 20, 2530.1902, -1531.5018, 25.1923) || IsPlayerInRangeOfPoint(playerid, 20, 2530.0493, -1524.3677, 24.5870))
                {
						new plname[MAX_PLAYER_NAME];
						GetPlayerName(playerid, plname, sizeof(plname));
		    			if(PlayerInfo[playerid][pFaction] == 7)
					    {
						   	ShowPlayerDialog(playerid, Vmod, DIALOG_STYLE_LIST, "Modificarile Masinii", "Reparatie\nRoti\nPaintJob\nHydraulice\nTunning avansat\nSpoiler\nRemove tunning", "Select", "Cancel");
						}
						else
						{
							SendClientMessage(playerid, COLOR_GRAD2, "Nu esti membru LSAS.");
							return 1;
		            	}
					SendClientMessage(playerid, COLOR_GRAD2, "Nu esti la sediu.");
					return 1;
				}
				return 1;
			}
Not working like that.

C:\Users\SpikeSpigel\Desktop\GM + comenzi\/IBP/Publics/OnPlayerCommandReceived.pwn(27800) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.


Re: dialog problem. - liquor - 09.07.2015

Warning 217 doesn't mean the code is incorrect. It just means that the code isn't properly arranged, and it is probably because of the forums.


Re: dialog problem. - SpikeSpigel - 09.07.2015

Quote:
Originally Posted by liquor
Посмотреть сообщение
Warning 217 doesn't mean the code is incorrect. It just means that the code isn't properly arranged, and it is probably because of the forums.
So-.. how can I repair that ? It looks ok in the GM, everything ok-.. still not working.