Help!How to add male/female dialogue
#1

how do i add Male/female dialogue? in this script
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_Close(File);

                SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great! Your Y_INI system works perfectly. Relog to save your stats!","Ok","");
			}
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
					ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
    }
    return 1;
}
Reply
#2

What command system are you using? DCMD, ZCMD?
Reply
#3

Quote:
Originally Posted by MadSkillz
Посмотреть сообщение
What command system are you using? DCMD, ZCMD?
Im using YCMD
Reply
#4

Hmm, make something like

pawn Код:
ShowPlayerDialog(playerid, DIALOG_SEXSELECTION, DIALOG_STYLE_LIST, "Please Choose Your Gender","Male\nFemale","Select","Cancel");

#define DIALOG_SEXSELECTION

case DIALOG_SEXSELECTION:
{

    if(listitem == 0)
    {
        SetPlayerSkin(playerid, MALESKIN); // Male Skin ID in MALESKIN
    }
    if(listitem == 1)
    {
        SetPlayerSkin(playerid, FEMALESKIN); // Female Skin ID in FEMALESKIN
    }

}
Its upto you to figure out where they go
Reply
#5

Quote:
Originally Posted by PhoenixB
Посмотреть сообщение
Hmm, make something like

pawn Код:
ShowPlayerDialog(playerid, DIALOG_SEXSELECTION, DIALOG_STYLE_LIST, "Please Choose Your Gender","Male\nFemale","Select","Cancel");

#define DIALOG_SEXSELECTION

case DIALOG_SEXSELECTION:
{

    if(listitem == 0)
    {
        SetPlayerSkin(playerid, MALESKIN); // Male Skin ID in MALESKIN
    }
    if(listitem == 1)
    {
        SetPlayerSkin(playerid, FEMALESKIN); // Female Skin ID in FEMALESKIN
    }

}
Its upto you to figure out where they go
I've got error saying:
Код:
C:\Program Files\Rockstar Games\GTA San Andreas\Server\SAMP\gamemodes\test1.pwn(111) : error 017: undefined symbol "DIALOG_SEXSELECTION"
C:\Program Files\Rockstar Games\GTA San Andreas\Server\SAMP\gamemodes\test1.pwn(116) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\Server\SAMP\gamemodes\test1.pwn(119) : error 017: undefined symbol "listitem"
C:\Program Files\Rockstar Games\GTA San Andreas\Server\SAMP\gamemodes\test1.pwn(123) : error 017: undefined symbol "listitem"
Reply
#6

PHP код:
#define DIALOG_SEXSELECTION (0)
ShowPlayerDialog(playeridDIALOG_SEXSELECTIONDIALOG_STYLE_LIST"Please Choose Your Gender","Male\nFemale","Select","Cancel");
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialogid)
    {
        case 
DIALOG_SEXSELECTION:
        {
            if(
response)
            switch(
listitem)
            {
                case 
0:SetPlayerSkin(playeridFEMALESKIN);
                case 
1:SetPlayerSkin(playeridMALESKIN);
            }
        }
    }
    return 
1;

Reply
#7

Yeah its your job to place them under OnPlayerDialogResponse and such
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)