dialog 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)
+--- Thread: dialog help (
/showthread.php?tid=528672)
dialog help -
9noober - 29.07.2014
What is the problem

Only the frist one "Buy 1 C4 works.
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 29)
{
if(!response)return 1;
if(response)
{
if(listitem == 0)
{
if(c4[playerid] == 5)
{
SendClientMessage(playerid,COLOR_SILVER,"[C4]:{FFFFFF}You can only buy 5 C4.");
}
else if(c4[playerid] == 4)
{
GivePlayerMoney(playerid,-500);
SendClientMessage(playerid,COLOR_SILVER,"[C4]:{FFFFFF}You have buy a C4 with 500$");
c4[playerid] = 5;
}
else
{
GivePlayerMoney(playerid,-500);
c4[playerid] += 1;
SendClientMessage(playerid,COLOR_SILVER,"[C4]:{FFFFFF}You have buy a C4 with 500$");
}
if(listitem == 1)
{
if(c4[playerid] == 0)
{
SendClientMessage(playerid,COLOR_SILVER,"[C4]:{FFFFFF}You have buy 5 C4 with 2500$");
GivePlayerMoney(playerid,-2500);
c4[playerid] = 5;
}
else
{
SendClientMessage(playerid,COLOR_SILVER,"[C4]:{FFFFFF}You can only buy 5 C4.");
}
if(listitem == 2)
{
if(c4[playerid] == 0)
{
SendClientMessage(playerid,COLOR_SILVER,"[C4]:{FFFFFF}You Don't have any C4.");
}
else
{
GivePlayerMoney(playerid,250);
SendClientMessage(playerid,COLOR_SILVER,"[C4]:{FFFFFF}You have sell a C4 for 250$");
c4[playerid] -= 1;
}
}
}
}
}
}
return 0;
}
Re: dialog help -
Battlezone - 29.07.2014
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 29)
{
if(!response)return 1;
if(response)return ShowPlayerDialog(playerid, 29, DIALOG_STYLE_LIST, "C4 shop", "Buy 1 C4 500$\nBuy 5 C4 2500$\nSell 1 C4 250$", "Buy", "Close");
{
switch(listitem)
{
case 0:
{
if(c4[playerid] == 5)
{
SendClientMessage(playerid,COLOR_SILVER,"[C4]:{FFFFFF}You can only buy 5 C4.");
}
else if(c4[playerid] == 4)
{
GivePlayerMoney(playerid,-500);
SendClientMessage(playerid,COLOR_SILVER,"[C4]:{FFFFFF}You have buy a C4 with 500$");
c4[playerid] = 5;
}
else
{
GivePlayerMoney(playerid,-500);
c4[playerid] += 1;
SendClientMessage(playerid,COLOR_SILVER,"[C4]:{FFFFFF}You have buy a C4 with 500$");
}
}
case 1:
{
if(c4[playerid] == 0)
{
SendClientMessage(playerid,COLOR_SILVER,"[C4]:{FFFFFF}You have buy 5 C4 with 2500$");
GivePlayerMoney(playerid,-2500);
c4[playerid] = 5;
}
else
{
SendClientMessage(playerid,COLOR_SILVER,"[C4]:{FFFFFF}You can only buy 5 C4.");
}
}
case 2:
{
if(c4[playerid] == 0)
{
SendClientMessage(playerid,COLOR_SILVER,"[C4]:{FFFFFF}You Don't have any C4.");
}
else
{
GivePlayerMoney(playerid,250);
SendClientMessage(playerid,COLOR_SILVER,"[C4]:{FFFFFF}You have sell a C4 for 250$");
c4[playerid] -= 1;
}
}
}
}
}
return 0;
}
Re: dialog help -
9noober - 29.07.2014
It works Thank you
Fixed
__________________________________________________ _____________________________________