SA-MP Forums Archive
Critical problem please help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Critical problem please help (/showthread.php?tid=224034)



Critical problem please help - Swiftz - 10.02.2011

I have many dialogs in my gamemode, When i use some dialogs in my filterscript with different ids , they dont work. Like only the first dialog appears and when i press any option in the dialog it doesnt work. I tried several times with different dialogs please help

Thanks!!


Re: Critical problem please help - antonio112 - 10.02.2011

If you have dialogs in Filterscript and Gamemode at the same time, it won`t work if I`m not wrong ... all your dialogs must be in your gamemode ...


Re: Critical problem please help - Swiftz - 11.02.2011

Really? Can anyone confirm it? If he was wrong tell me a solution pleaseee


Re: Critical problem please help - Calgon - 11.02.2011

Return 0 for your OnDialogResponse callback so other (filter)scripts can retrieve the response information.

See here for an explanation (hint: where it explains returns).


Re: Critical problem please help - Swiftz - 11.02.2011

@Calgon Thanks for helping me out can you explain it what i have to do in-detail sorry im new to scripting, thanks!


Re: Critical problem please help - Stigg - 11.02.2011

In your gamemode.

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
//blah
//blah
}
return 0; //at the very end.
}

Peace...


Re: Critical problem please help - Swiftz - 11.02.2011

There are return 0 for individual dialog responses this is what is in the end of dialogresponse what should i edit here?

Код:
	if(dialogid == UPGRADEMENU6) //misc list
	{
	    if(response)
	    {
	        switch(listitem)
	        {
	            case 0:
	            {
	                if(PlayerInfo[playerid][pCash] >= 50000) { PlayerInfo[playerid][hAlarmSystem] = 1; MiscPriceTemp[playerid] = MiscPriceTemp[playerid]+50000; SendClientMessage(playerid, COLOR_YELLOW, "You have ordered an alarm system to be installed for $50,000."); } else { SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !"); } //alarm
	            }
	            case 1:
	            {
	                if(PlayerInfo[playerid][pCash] >= 10000) { SendClientMessage(playerid, COLOR_GREY, "   Out of Stock !"); } else { SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !"); } //2x nos
	            }
	            case 2:
	            {
	                if(PlayerInfo[playerid][pCash] >= 35000) { SendClientMessage(playerid, COLOR_GREY, "   Out of Stock !"); } else { SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !"); } //6x nos
	            }
	            case 3:
	            {
	                if(PlayerInfo[playerid][pCash] >= 35000) {  SendClientMessage(playerid, COLOR_GREY, "   Out of Stock !"); } else { SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !"); } //license plate
	            }
	            case 4:
	            {
	                if(PlayerInfo[playerid][pCash] >= 15000) { PlayerInfo[playerid][hVehLock] = 1; MiscPriceTemp[playerid] = MiscPriceTemp[playerid]+15000; SendClientMessage(playerid, COLOR_YELLOW, "You have ordered a vehicle lock for $15,000."); } else { SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !"); } //vehicle lock
	            }
	        }
	    }
	    if(PlayerInfo[playerid][pCash] >= MiscPriceTemp[playerid])
     	{
     	    new string[126];
     		format(string, sizeof(string), "You have bought a misc. item for $%d", MiscPriceTemp[playerid]);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			PlayerInfo[playerid][pCash] -= MiscPriceTemp[playerid];
			GivePlayerMoney(playerid, -MiscPriceTemp[playerid]);
			MiscPriceTemp[playerid] = 0;
   			OnPlayerSave(playerid);
      		return 1;
		}
	}
    return 0;
}



Re: Critical problem please help - Swiftz - 11.02.2011

There are return 0 for individual dialog responses this is what is in the end of dialogresponse what should i edit here?

Код:
	if(dialogid == UPGRADEMENU6) //misc list
	{
	    if(response)
	    {
	        switch(listitem)
	        {
	            case 0:
	            {
	                if(PlayerInfo[playerid][pCash] >= 50000) { PlayerInfo[playerid][hAlarmSystem] = 1; MiscPriceTemp[playerid] = MiscPriceTemp[playerid]+50000; SendClientMessage(playerid, COLOR_YELLOW, "You have ordered an alarm system to be installed for $50,000."); } else { SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !"); } //alarm
	            }
	            case 1:
	            {
	                if(PlayerInfo[playerid][pCash] >= 10000) { SendClientMessage(playerid, COLOR_GREY, "   Out of Stock !"); } else { SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !"); } //2x nos
	            }
	            case 2:
	            {
	                if(PlayerInfo[playerid][pCash] >= 35000) { SendClientMessage(playerid, COLOR_GREY, "   Out of Stock !"); } else { SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !"); } //6x nos
	            }
	            case 3:
	            {
	                if(PlayerInfo[playerid][pCash] >= 35000) {  SendClientMessage(playerid, COLOR_GREY, "   Out of Stock !"); } else { SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !"); } //license plate
	            }
	            case 4:
	            {
	                if(PlayerInfo[playerid][pCash] >= 15000) { PlayerInfo[playerid][hVehLock] = 1; MiscPriceTemp[playerid] = MiscPriceTemp[playerid]+15000; SendClientMessage(playerid, COLOR_YELLOW, "You have ordered a vehicle lock for $15,000."); } else { SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !"); } //vehicle lock
	            }
	        }
	    }
	    if(PlayerInfo[playerid][pCash] >= MiscPriceTemp[playerid])
     	{
     	    new string[126];
     		format(string, sizeof(string), "You have bought a misc. item for $%d", MiscPriceTemp[playerid]);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			PlayerInfo[playerid][pCash] -= MiscPriceTemp[playerid];
			GivePlayerMoney(playerid, -MiscPriceTemp[playerid]);
			MiscPriceTemp[playerid] = 0;
   			OnPlayerSave(playerid);
      		return 1;
		}
	}
    return 0;
}



Re: Critical problem please help - Sasino97 - 11.02.2011

pawn Код:
return 1;
at every dialog ID, and at the end use
pawn Код:
return 0;
before the final closing bracket.

You should do this in the GM and in the FS.


Re: Critical problem please help - Swiftz - 11.02.2011

Still couldnt figure out, Whats the difference if i put return 0 at the end of every dialog in my gm which is not related to my dialog in fs, I put return 0 in dialogs of fs but still it didnt work