Problem with dialogs
#1

Ok,im making class dialogs and i need help.

pawn Код:
if(listitem == 1)  // Suck
            {
            if(GetPlayerScore(playerid) < 90)
            {
                 SendClientMessage(playerid, 0xFFFFFF, "Need 90score.");
                 return 0;
            }
            else if(GetPlayerScore(playerid) > 90)
            {
               SetPlayerArmour(playerid, 100.0);
            }
            }
What's wrong?I can choose this class even if i have 50 score :/
Reply
#2

pawn Код:
if(listitem == 1)  // Suck
{
            if(GetPlayerScore(playerid) > 90)
            {
                 SendClientMessage(playerid, 0xFFFFFF, "Need 90score.");
                 return 0;
            }

            else if(GetPlayerScore(playerid) < 90)
            {
                 SetPlayerArmour(playerid, 100.0);
            }
}
Reply
#3

pawn Код:
if(listitem == 1)  // Suck
{
    if(GetPlayerScore(playerid) < 90) return SendClientMessage(playerid, 0xFFFFFF, "Need 90score.");
    SetPlayerArmour(playerid, 100.0);
}
Edit: Somehow a character that wasn't suppose to be there, appeared. lol^
Reply
#4

Dont work both,i made this:


pawn Код:
if(listitem == 1)  // Suck
            {
            if(GetPlayerScore(playerid) < 90) //If player dont have 90 score
            {
                 SendClientMessage(playerid, 0xFFFFFF, "Need 90 score.");
                 return 0;
            }
            else if(GetPlayerScore(playerid) > 90) //If player has more than 90 score,he can choose.
            {
                 SetPlayerArmour(playerid, 100.0);
            }
            }
        }
      return 1;
    }
Reply
#5

If the code I gave you didn't work, are you sure that the score is even set correctly? I made a quick filterscript and it works like a charm for me.
Reply
#6

Yeah,it now works,i was needed to list item from 1.

Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)