09.04.2011, 20:35
For gender:
Anywhere, like in a command or something
Later...
I am actually suprised you don't know that.
And a command to see your gender
Anywhere, like in a command or something
pawn Код:
ShowPlayerDialog( playerid, 0, DIALOG_STYLE_LIST, "Are you a male or female?", "Male\nFemale, "Choose", "" )
pawn Код:
new gender[ MAX_PLAYERS ];
public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
{
if( dialogid == 0 )
{
if( response )
{
switch( listitem )
{
case 0: gender[ playerid ] = 1; // 1 is male, 2 is female
case 1: gender[ playerid ] = 2;
}
}
}
return false;
}
pawn Код:
public OnPlayerConnect( playerid )
{
gender[ playerid ] = 0;
return 1;
}
pawn Код:
public OnPlayerDisconnect( playerid, reason )
{
gender[ playerid ] = 0;
return 1;
}
And a command to see your gender
pawn Код:
CMD:mygender( playerid, params[ ] )
{
if( gender[ playerid ] == 1 )
SendClientMessage( playerid, 0xAAAAAA, "Your gender is male" );
else if( gender[ playerid ] == 2 )
SendClientMessage( playerid, 0xAAAAAA, "Your gender is female" );
return 1;
}