Gender Selection -
Dziugsas - 16.07.2013
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
Re: Gender Selection -
MP2 - 16.07.2013
= 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: "").
Re: Gender Selection -
Dziugsas - 16.07.2013
Dumb me
Re: Gender Selection -
JimmyCh - 16.07.2013
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!
Re: Gender Selection -
Dziugsas - 16.07.2013
What about other error?
Re: Gender Selection -
JimmyCh - 16.07.2013
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","");
Re: Gender Selection -
MP2 - 16.07.2013
I told you how to fix both errors. Don't only read half my post..
Re: Gender Selection -
Dziugsas - 16.07.2013
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);
}
}
Re: Gender Selection -
Dziugsas - 16.07.2013
I think i put brackets somewhere wrong :/
Re: Gender Selection -
JimmyCh - 16.07.2013
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);
}