Dialog help
#10

Here you go mate, i added the PlayerInfo, make sure you have the Fight styles loading on OnPlayerLogin and creating OnPlayerRegister & Update though you will have to make functions like

pawn Код:
forward fightstyle_Boxing(playerid);
public fightstyle_Boxing(playerid)
{
SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING);
}
Put this under public OnPlayerCommandText
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/fightstyle", cmdtext, true, 11) == 0)
    {
        ShowPlayerDialog(playerid, 1234, DIALOG_STYLE_LIST, "Fighting Style", "Elbow\nBoxing\nGrabkick\nKneehead\nKungfu\nNormal", "Learn", "Cancel");
        return 1;
    }
    return 0;
}
And this public OnDialogResponse
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1234)
    {
      if(response)
      {
        if(listitem == 0)
        {
          SetPlayerFightingStyle(playerid, FIGHT_STYLE_ELBOW);
                SendClientMessage(playerid, 0xFFFFFFFF, "You've learned fighting style 'Elbow'");
                PlayerInfo[playerid][elbow] = 1;
                PlayerInfo[playerid][boxing] = 0;
                PlayerInfo[playerid][kneehead] = 0;
        PlayerInfo[playerid][grabkick] = 0;
        PlayerInfo[playerid][KungFu] = 0;
        PlayerInfo[playerid][normal] = 0;
            }
            if(listitem == 1)
            {
              SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING);
              SendClientMessage(playerid, 0xFFFFFFFF, "You've learned fighting style 'Boxing'");
                PlayerInfo[playerid][elbow] = 0;
                PlayerInfo[playerid][boxing] = 1;
                PlayerInfo[playerid][kneehead] = 0;
        PlayerInfo[playerid][grabkick] = 0;
        PlayerInfo[playerid][KungFu] = 0;
        PlayerInfo[playerid][normal] = 0;
            }
            if(listitem == 2)
            {
              SetPlayerFightingStyle(playerid, FIGHT_STYLE_GRABKICK);
              SendClientMessage(playerid, 0xFFFFFFFF, "You've learned fighting style 'Grabkick'");
              PlayerInfo[playerid][elbow] = 0;
                PlayerInfo[playerid][boxing] = 0;
                PlayerInfo[playerid][kneehead] = 0;
        PlayerInfo[playerid][grabkick] = 1;
        PlayerInfo[playerid][KungFu] = 0;
        PlayerInfo[playerid][normal] = 0;
            }
            if(listitem == 3)
            {
              SetPlayerFightingStyle(playerid, FIGHT_STYLE_KNEEHEAD);
              SendClientMessage(playerid, 0xFFFFFFFF, "You've learned fighting style 'KNEEHEAD'");
              PlayerInfo[playerid][elbow] = 0;
                PlayerInfo[playerid][boxing] = 0;
                PlayerInfo[playerid][kneehead] = 1;
        PlayerInfo[playerid][grabkick] = 0;
        PlayerInfo[playerid][KungFu] = 0;
        PlayerInfo[playerid][normal] = 0;
            }
            if(listitem == 4)
            {
              SetPlayerFightingStyle(playerid, FIGHT_STYLE_KUNGFU);
              SendClientMessage(playerid, 0xFFFFFFFF, "You've learned fighting style 'KUNGFU'");
              PlayerInfo[playerid][elbow] = 0;
                PlayerInfo[playerid][boxing] = 0;
                PlayerInfo[playerid][kneehead] = 0;
        PlayerInfo[playerid][grabkick] = 0;
        PlayerInfo[playerid][KungFu] = 1;
        PlayerInfo[playerid][normal] = 0;
            }
            if(listitem == 5)
            {
              SetPlayerFightingStyle(playerid, FIGHT_STYLE_NORMAL);
              SendClientMessage(playerid, 0xFFFFFFFF, "You've learned fighting style 'Normal'");
              PlayerInfo[playerid][elbow] = 0;
                PlayerInfo[playerid][boxing] = 0;
                PlayerInfo[playerid][kneehead] = 0;
        PlayerInfo[playerid][grabkick] = 0;
        PlayerInfo[playerid][KungFu] = 0;
        PlayerInfo[playerid][normal] = 1;
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Dialog help - by WardenCS - 29.11.2009, 12:19
Re: Dialog help - by Niixie - 29.11.2009, 12:30
Re: Dialog help - by WardenCS - 29.11.2009, 12:34
Re: Dialog help - by Niixie - 29.11.2009, 12:35
Re: Dialog help - by WardenCS - 29.11.2009, 12:39
Re: Dialog help - by Niixie - 29.11.2009, 12:41
Re: Dialog help - by WardenCS - 29.11.2009, 12:44
Re: Dialog help - by Niixie - 29.11.2009, 13:20
Re: Dialog help - by WardenCS - 29.11.2009, 13:45
Re: Dialog help - by [NYRP]Mike. - 29.11.2009, 13:56

Forum Jump:


Users browsing this thread: 4 Guest(s)