Posts: 328
Threads: 79
Joined: Jan 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!!
Posts: 970
Threads: 16
Joined: Aug 2009
Reputation:
0
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 ...
Posts: 328
Threads: 79
Joined: Jan 2011
Really? Can anyone confirm it? If he was wrong tell me a solution pleaseee
Posts: 6,129
Threads: 36
Joined: Jan 2009
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).
Posts: 328
Threads: 79
Joined: Jan 2011
@Calgon Thanks for helping me out can you explain it what i have to do in-detail sorry im new to scripting, thanks!
Posts: 2,038
Threads: 17
Joined: Aug 2010
Reputation:
0
In your gamemode.
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
//blah
//blah
}
return 0; //at the very end.
}
Peace...
Posts: 328
Threads: 79
Joined: Jan 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;
}
Posts: 328
Threads: 79
Joined: Jan 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;
}
Posts: 328
Threads: 79
Joined: Jan 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