SA-MP Forums Archive
SetPlayerFightingStyle Question ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SetPlayerFightingStyle Question ? (/showthread.php?tid=375159)



SetPlayerFightingStyle Question ? - Glint - 05.09.2012

Hello guys Does SetPlayerFightingStyle work or it is just me here check the code
pawn Код:
case DIALOG_DUEL_BOXING:
        {
            if(response)
            {
                if(listitem == 0)
                {
                    SetPlayerFightingStyle(playerid, FIGHT_STYLE_NORMAL);
                    SendClientMessage(playerid, -1, "{FFFF00}D-DM : {FFFFFF}You Have Selected The {FF0000}Normal{FFFFFF} Fighting Style");
                }
                else if(listitem == 1)
                {
                    SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING);
                    SendClientMessage(playerid, -1, "{FFFF00}D-DM : {FFFFFF}You Have Selected The {FF0000}Boxing{FFFFFF} Fighting Style");
                }
                else if(listitem == 2)
                {
                    SetPlayerFightingStyle(playerid, FIGHT_STYLE_KUNGFU);
                    SendClientMessage(playerid, -1, "{FFFF00}D-DM : {FFFFFF}You Have Selected The {FF0000}Kung Fu{FFFFFF} Fighting Style");
                }
                else if(listitem == 3)
                {
                    SetPlayerFightingStyle(playerid, FIGHT_STYLE_KNEEHEAD);
                    SendClientMessage(playerid, -1, "{FFFF00}D-DM : {FFFFFF}You Have Selected The {FF0000}Kneehead{FFFFFF} Fighting Style");
                }
                else if(listitem == 4)
                {
                    SetPlayerFightingStyle(playerid, FIGHT_STYLE_GRABKICK);
                    SendClientMessage(playerid, -1, "{FFFF00}D-DM : {FFFFFF}You Have Selected The {FF0000}Grab Kick{FFFFFF} Fighting Style");
                }
                else if(listitem == 5)
                {
                    SetPlayerFightingStyle(playerid, FIGHT_STYLE_ELBOW);
                    SendClientMessage(playerid, -1, "{FFFF00}D-DM : {FFFFFF}You Have Selected The {FF0000}Elbow{FFFFFF} Fighting Style");
                }
            }
        }
what is the problem with it, when i change the fighting style, the style is the same.


Re: SetPlayerFightingStyle Question ? - Q.I - 05.09.2012

pawn Код:
example:

CMD:fight(playerid)
{
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "FIGHTING STYLES", "{FFFFFF} ", "Ok", "Cancel");
        return 1;
}




if (dialogid == 2) {
    if (response) {
      if (listitem == 0) {
        SetPlayerFightingStyle(playerid, FIGHT_STYLE_NORMAL);
     
      }
      if (listitem == 1) {
        SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING);
       
      }
      if (listitem == 2) {
        SetPlayerFightingStyle(playerid, FIGHT_STYLE_KUNGFU);
       
      }
      if (listitem == 3) {
        SetPlayerFightingStyle(playerid, FIGHT_STYLE_KNEEHEAD);
       
      }
      if (listitem == 4) {
        SetPlayerFightingStyle(playerid, FIGHT_STYLE_GRABKICK);
       
      }
      if (listitem == 5) {
        SetPlayerFightingStyle(playerid, FIGHT_STYLE_ELBOW);
       
      }
    }
  }



Re: SetPlayerFightingStyle Question ? - JustinAn - 05.09.2012

If you didn't add a 'return 0;' at the ending of 'OnDialogResponse' you better should, that might fix it.