Dialog not working... -
McCarthy - 26.11.2011
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!");
}
}
}
}
Re: Dialog not working... -
Mr_Scripter - 26.11.2011
maybe try something like this
pawn Код:
if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, Blabla);//your more Code ..
Re: Dialog not working... -
McCarthy - 26.11.2011
Thats how I originally made it so I thought that was the problem and changed the code into that but obviosly it wasn't.
Re: Dialog not working... -
Joshb93 - 26.11.2011
Return your dialog..
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!");
}
}
}
return 1;
}
Re: Dialog not working... -
McCarthy - 26.11.2011
Tried that aswell already, no effect
Re: Dialog not working... -
Chris White - 26.11.2011
Look, idk but i think you should put
before
Re: Dialog not working... -
McCarthy - 27.11.2011
That doesnt make sense or does it?
Re: Dialog not working... -
Tanush123 - 27.11.2011
change
to
Re: Dialog not working... -
Kostas' - 27.11.2011
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); //minimum 1000 max 9999
new randphone = 1000 + random(8999);
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
if (listitem == 5) {
SCM(playerid,COLOR_RED,"Sorry we are out of stock with phone books, come back later!");
}
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!");
}
}
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!");
}
}
}
}