Roleplay register system?
#2

For gender:
Anywhere, like in a command or something
pawn Код:
ShowPlayerDialog( playerid, 0, DIALOG_STYLE_LIST, "Are you a male or female?", "Male\nFemale, "Choose", "" )
Later...
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;
}
I am actually suprised you don't know that.

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;
}
Reply


Messages In This Thread
Roleplay register system? - by justsomeguy - 09.04.2011, 20:15
Re: Roleplay register system? - by Mean - 09.04.2011, 20:35
Re: Roleplay register system? - by justsomeguy - 09.04.2011, 20:37
Re: Roleplay register system? - by Mean - 09.04.2011, 20:39

Forum Jump:


Users browsing this thread: 1 Guest(s)