Sex/Age system
#1

hey guys i have a server and i have login system bla..bla.. and now i want to make sex system (male, female) and age if u can help me +rep!
Reply
#2

PHP код:
#define GLAD2BEHERE 1
 
// In some command
ShowPlayerDialog(playeridGLAD2BEHEREDIALOG_STYLE_MSGBOX"Gender?""Are you male or female?""Male""Female");
 
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == DIALOG_WELCOME)
    {
        if(
response// If they clicked 'Yes' or pressed enter
        
{
            
PlayerInfo[playerid][pSex] == 1;
        }
        else 
// Pressed ESC or clicked cancel
        
{
            
PlayerInfo[playerid][pSex] == 2;
        }
        return 
1// We handled a dialog, so return 1. Just like OnPlayerCommandText.
    
}
 
    return 
0// You MUST return 0 here! Just like OnPlayerCommandText.

Above i just defined the dialog and showed u how to make the dialog to show the play

Then pSex = 1 male pSex = 2 female now we can
playerinfo or w/e ur saving system is
PHP код:

//example
CMD:Sex(playeridparams[])
{
            if(
PlayerInfo[playerid][pSex] == 1)
            {
                
SendClientMessage(playerid, -1"You Are Male");
            }
            else if(
PlayerInfo[playerid][pSex] == 2)
            {
                  
SendClientMessage(playerid, -1"You Are Female");
            }
            return 
1;

Theere is a command version


PHP код:

            
if(PlayerInfo[playerid][pSex] == 1)
            {
            
SendClientMessage(playerid, -1"You Are Male");
            }
            else if(
PlayerInfo[playerid][pSex] == 2)
            {
            
SendClientMessage(playerid, -1"You Are Female");
            } 
u can put that
or u can add that do ur /stats cmd or sumthing

PHP код:
CMD:getsex(playeridparams[])
{
        new 
playerbstring[128];
        if(
sscanf(params"u"playerb)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /getsex [playerid] ");
        {
            if(
PlayerInfo[playerb][pSex] == 1)
            {
            
SendClientMessage(playerid, -1"You Are Male");
            }
            else if(
PlayerInfo[playerb][pSex] == 2)
            {
            
SendClientMessage(playerid, -1"You Are Female");
            }
        }
        return 
1;

and a final cmd

Sorry for the wait i was trying to make to make them i figure out a simple way, REP ME IF i helped you
Reply
#3

But how can i do so it saves i have login system with Y_INI
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)