Another problem with dialogs
#1

Ok,in my last topic i've fixed dialogs problem,but now i've another.

pawn Код:
if(listitem == 1)  // Suck
            {
            if(GetPlayerScore(playerid) < 90) //if dont have 90 score
            {
                 SendClientMessage(playerid,0xFF0000AA,"90 score needed.");
                 return 0;
            }
            else if(GetPlayerScore(playerid) > 90) //if he have
            {
               SetPlayerArmour(playerid, 100.0);
               GivePlayerWeapon(playerid, 35, 5);
            }
            }
The problem is: When i click on this and i've -90 score,i cant use it (it's normal),but it closes the dialog.

How to,when a player cant use this dialog,it will return to dialog menu?
Reply
#2

redo the ShowPlayerDialog code before you return it.

IE:

pawn Код:
if(GetPlayerScore(playerid) < 90) //if dont have 90 score
            {
                 SendClientMessage(playerid,0xFF0000AA,"90 score needed.");
                 ShowPlayerDialog(playerid, /* ... */);
                 return 0;
            }
Reply
#3

Note that listitem starts with 0, so the first one is 0, second one 1, but If you already knew that do as him above.

I'd also like to mention the other code wont work, It will only work if you have 91 or more in score, as
> 90 means MORE then 90.

So do it >= 90 . (means 90 OR higher)
Reply
#4

Thanks both.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)