26.11.2011, 15:28
Well yeah, I just cant figure out why this isn't working...it seems fine to my eyes, but maybe some more experienced scripter will detect the problem (When I select anything in the dialog it doesn't work.)
pawn Код:
if(dialogid == 60)
{
if(response)
{
if (listitem == 0)
{
if(GetPlayerMoney(playerid) < 500)
{
SCM(playerid,COLOR_RED,"You dont have enough money to buy this!");
}
else
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new randphone = 1000 + random(8999);//minimum 1000 max 9999
AccountInfo[playerid][pPnumber] = randphone;
GivePlayerMoney(playerid,-500);
format(string, sizeof(string), "Mobile Phone purchased your new number is %d", randphone);
SendClientMessage(playerid, COLOR_GREEN, string);
OnPlayerUpdateAccount(playerid);
}
}
else if (listitem == 1)
{
if(GetPlayerMoney(playerid) < 100)
{
SCM(playerid,COLOR_RED,"You dont have enough money to buy this!");
}
else
{
AccountInfo[playerid][pSeeds] = 5;
GivePlayerMoney(playerid,-100);
SCM(playerid,COLOR_GREEN,"You bought 5 seeds!");
OnPlayerUpdateAccount(playerid);
}
}
else if (listitem == 2)
{
if(GetPlayerMoney(playerid) < 25)
{
SCM(playerid,COLOR_RED,"You dont have enough money to buy this!");
}
else
{
GivePlayerMoney(playerid,-25);
SCM(playerid,COLOR_GREEN,"You bought a cigarette!");
SetPlayerSpecialAction(playerid,21);
}
}
else if (listitem == 3)
{
if(GetPlayerMoney(playerid) < 15)
{
SCM(playerid,COLOR_RED,"You dont have enough money to buy this!");
}
else
{
GivePlayerMoney(playerid,-15);
SCM(playerid,COLOR_GREEN,"You bought a bottle of beer!");
SetPlayerSpecialAction(playerid,20);
}
}
else if (listitem == 4)
{
if(GetPlayerMoney(playerid) < 1000)
{
SCM(playerid,COLOR_RED,"You dont have enough money to buy this!");
}
else
{
AccountInfo[playerid][pCB] = 1;
GivePlayerMoney(playerid,-1000);
SCM(playerid,COLOR_GREEN,"You bought a CB Radio! (/joinchannel , /cb )");
OnPlayerUpdateAccount(playerid);
}
}
else if (listitem == 5)
{
SCM(playerid,COLOR_RED,"Sorry we are out of stock with phone books, come back later!");
}
else if (listitem == 6)
{
if(GetPlayerMoney(playerid) < 100)
{
SCM(playerid,COLOR_RED,"You dont have enough money to buy this!");
}
else
{
SetPlayerHealth(playerid,100);
SCM(playerid,COLOR_GREEN,"You ate some tacos!");
}
}
else if (listitem == 7)
{
if(GetPlayerMoney(playerid) < 100)
{
SCM(playerid,COLOR_RED,"You dont have enough money to buy this!");
}
else
{
GivePlayerWeapon(playerid,46,1);
SCM(playerid,COLOR_GREEN,"You bought a parachute!");
}
}
}
}