29.07.2014, 11:00
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;
}