Gender Selection
#1

pawn Code:
F:\Sampui\Login and Register Sytem Y_INI\gamemodes\test.pwn(112) : warning 211: possibly unintended assignment
F:\Sampui\Login and Register Sytem Y_INI\gamemodes\test.pwn(114) : warning 202: number of arguments does not match definition
pawn Code:
if(PlayerInfo[playerid][NewPlayer] = true) //112
        {
        ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX,"Jus esate?", "Vyras","Moteris"); //114
        PlayerInfo[playerid][NewPlayer] = false;
Any help?
And Can you explain me?These errors , cause i want to learn
Reply
#2

= means assign a value
== means to check if equal

Change the = to ==.

As for the second error, you need to add another sting to the end - if you want only one button, pass a blank string (two quotes: "").
Reply
#3

Dumb me
Reply
#4

pawn Code:
if(PlayerInfo[playerid][NewPlayer] == true) //112
        {
        ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX,"Jus esate?", "Vyras","Moteris", ""); //114
        PlayerInfo[playerid][NewPlayer] = false;
First of all, You did if(PlayerInfo[playerid][NewPlayer] = true) >> This doesnt check if its true, this sets it to true, you need to put == true.

Second, ShowPlayerDialog should be like this:
pawn Code:
(playerid, dialogid, style, caption[], info[], button1[], button2[])
What you did there was:
pawn Code:
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_MSGBOX, caption[], info[], button1[]);
After that you should atleast put button2[] like this: ""

Hope i helped u!
Reply
#5

What about other error?
Reply
#6

This:
pawn Code:
ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX,"Jus esate?", "Vyras","Moteris", "");
If Vyras means male and Moteris means female(or vice versa)
You need to put it like this:

pawn Code:
ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX,"Jus esate?", "Vyras\nMoteris", "Ok","");
Reply
#7

I told you how to fix both errors. Don't only read half my post..
Reply
#8

Thanks for explaining.What about here?
pawn Code:
if(dialogid == 3)
        {
            if(response)
            {
                if (listitem == 0)
                {
                    PlayerInfo[playerid][pGender] = 1;
                    SendClientMessage(playerid, 1,"So you are male.");
                }
                else if (listitem == 1)
                {
                    PlayerInfo[playerid][pGender] = 2;
                    SendClientMessage(playerid,1,"So you are female.");
                }
                }
                else return Kick(playerid);
                }
        }
Reply
#9

I think i put brackets somewhere wrong :/
Reply
#10

First,
pawn Code:
ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX,"Jus esate?", "Vyras\nMoteris", "Ok","Cancel");
Then here:
pawn Code:
if(dialogid == 3)
{
            if(response)
            {
                  if (listitem == 0)
                  {
                    PlayerInfo[playerid][pGender] = 1;
                    SendClientMessage(playerid, -1,"So you are male.");
                  }
                  else if (listitem == 1)
                  {
                    PlayerInfo[playerid][pGender] = 2;
                    SendClientMessage(playerid, -1,"So you are female.");
                  }
            }
                else return Kick(playerid);
 }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)