03.10.2012, 09:55
When I compile my scipt it doesn't show me any errors but when I type the command where it show me the fishing dialog it doesn't work. Will give Rep to man who help me with this bug.
Код:
#define FISHINGMENU 43891
PHP код:
if(dialogid == FISHINGMENU)
{
if(listitem == 0)
{
if(GetPlayerMoney(playerid) >= FishingToolPrice)
{
PlayerInfo[playerid][pFishingrod] += 1;
SendClientMessageEx(playerid, COLOR_GRAD4, "Fishing Rod purchased.");
SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Now you can do /fish to fishing.");
GivePlayerMoney(playerid, -FishingToolPrice);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You don't have enough money");
}
}
if(listitem == 1)
{
format(string,sizeof(string),"Enter below how much baits do you want.\n$%d per one",BaitPrice);
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Baits",string,"Purchase","Exit");
}
}
if(dialogid == 43892 && response)
{
new price = BaitPrice;
new baits = strval(inputtext);
if(baits > 0)
{
new price1 = price*baits;
if(GetPlayerMoney(playerid) >= price1)
{
GivePlayerMoney(playerid, -price1);
format(string,sizeof(string),"You just purchased %d worms for $%d", baits, price1);
SendClientMessage(playerid, COLOR_GREEN, string);
PlayerInfo[playerid][pBite] += baits;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You don't have that much money.");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You can't buy baits less than 0");
}
}
PHP код:
CMD:fishshop(playerid, params[])
{
if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
{
SendClientMessageEx(playerid, COLOR_GREY, "Fuuuuuu");
ShowPlayerDialog(playerid, FISHINGMENU, DIALOG_STYLE_LIST, "Fish shop", "Fishing Rod (150$)\nFishing Bait(15$ each)", "Buy", "Cancel");
}
return 1;
}