Dialog Response Help
#1

Hello !
Guys, I'm currently learning how to script, and today i wanted to make something.
Basically, I made a DIALOG_STYLE_LIST when the user registers to the server, so they select American or Russian.
I want it so that if they pick the first choice their faction gets set to 1, or if they pick the second option, they're
faction gets set to 2.
So far i have:
Код:
	else if(dialogid == 5)
	{
Thank you very much, If you need any part of the code, post below which part, I'll post it ASAP. Thank you very much!
Reply
#2

pawn Код:
#define TEAM_AMERICA 1
#define TEAM_RUSSIA 2


else if(dialogid == 5)
    {
               SetPlayerTeam(playerid,1);
Reply
#3

I got this:

Team 1:
Quote:

PlayerInfo[playerid][pFac] = 1];
PlayerInfo[playerid][pFacRank] = 0;
PlayerInfo[playerid][pFacLeader] = 0;
PlayerInfo[playerid][pFacDiv] = 0;
PlayerInfo[playerid][pFacDivLeader] = 0;

Team 2
Quote:

PlayerInfo[playerid][pFac] = 2];
PlayerInfo[playerid][pFacRank] = 0;
PlayerInfo[playerid][pFacLeader] = 0;
PlayerInfo[playerid][pFacDiv] = 0;
PlayerInfo[playerid][pFacDivLeader] = 0;

Is it right? If yes.. how do i put it in..
Reply
#4

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 5)
    {
        switch(listitem)
        {
            case 0:
            {
                PlayerInfo[playerid][pFac] = 1];
                PlayerInfo[playerid][pFacRank] = 0;
                PlayerInfo[playerid][pFacLeader] = 0;
                PlayerInfo[playerid][pFacDiv] = 0;
                PlayerInfo[playerid][pFacDivLeader] = 0;
            }
            case 1:
            {
                PlayerInfo[playerid][pFac] = 2];
                PlayerInfo[playerid][pFacRank] = 0;
                PlayerInfo[playerid][pFacLeader] = 0;
                PlayerInfo[playerid][pFacDiv] = 0;
                PlayerInfo[playerid][pFacDivLeader] = 0;
            }
        }

    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by Gogeta101
Посмотреть сообщение
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 5)
    {
        switch(listitem)
        {
            case 0:
            {
                PlayerInfo[playerid][pFac] = 1];
                PlayerInfo[playerid][pFacRank] = 0;
                PlayerInfo[playerid][pFacLeader] = 0;
                PlayerInfo[playerid][pFacDiv] = 0;
                PlayerInfo[playerid][pFacDivLeader] = 0;
            }
            case 1:
            {
                PlayerInfo[playerid][pFac] = 2];
                PlayerInfo[playerid][pFacRank] = 0;
                PlayerInfo[playerid][pFacLeader] = 0;
                PlayerInfo[playerid][pFacDiv] = 0;
                PlayerInfo[playerid][pFacDivLeader] = 0;
            }
        }

    }
    return 1;
}
Fix:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 5)
    {
        switch(listitem)
        {
            case 0:
            {
                PlayerInfo[playerid][pFac] = 1;
                PlayerInfo[playerid][pFacRank] = 0;
                PlayerInfo[playerid][pFacLeader] = 0;
                PlayerInfo[playerid][pFacDiv] = 0;
                PlayerInfo[playerid][pFacDivLeader] = 0;
            }
            case 1:
            {
                PlayerInfo[playerid][pFac] = 2;
                PlayerInfo[playerid][pFacRank] = 0;
                PlayerInfo[playerid][pFacLeader] = 0;
                PlayerInfo[playerid][pFacDiv] = 0;
                PlayerInfo[playerid][pFacDivLeader] = 0;
            }
        }

    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)