SetPlayerFightingStyle Help need.
#1

I make a cmd for changing fighting style but what to add to save the fighting style??

CMD:
pawn Код:
if(strcmp(cmd, "/smeniskill", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
        if(PlayerToPoint(2.0, playerid, 756.2297,5.8995,1000.6987))
        {
            ShowPlayerDialog(playerid, SKILLMENI, DIALOG_STYLE_LIST, "Smeni Skill", "Normal\nBoxing\nKungfu\nKickBoxing\nGrabkick\nElbow", "U redu", "Izlaz");
            SendClientMessage(playerid, COLOR_GREEN, " ** Odberi koj skill go sakas!");
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "* %s menja skill.", sendername);
            ProxDetector(30.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
        }
        return 1;
    }
 }
DIALOG:
pawn Код:
if(dialogid == SKILLMENI) // kampfarten
    {
        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);
            }
        }
        return 1;
    }
Reply
#2

at the top of your script:
pawn Код:
new fstyle[MAX_PLAYERS];
pawn Код:
public OnPlayerConnect(playerid)
{
  fstyle[playerid] = 0;
}
and for your dialog:
pawn Код:
if(dialogid == SKILLMENI) // kampfarten
    {
        if(response)
        {
            fstyle[playerid] = listitem;
            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);
            }
        }
        return 1;
    }
later you can check it like:
if(fstyle[playerid] == X)
Reply
#3

Quote:
Originally Posted by Sascha
Посмотреть сообщение
at the top of your script:
pawn Код:
new fstyle[MAX_PLAYERS];
pawn Код:
public OnPlayerConnect(playerid)
{
  fstyle[playerid] = 0;
}
and for your dialog:
pawn Код:
if(dialogid == SKILLMENI) // kampfarten
    {
        if(response)
        {
            fstyle[playerid] = listitem;
            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);
            }
        }
        return 1;
    }
later you can check it like:
if(fstyle[playerid] == X)
Not working..
Reply
#4

Quote:
Originally Posted by GBLTeam
Посмотреть сообщение
Not working..
You'll need to save that into a file first using what ever method you are using.
Reply
#5

Pazi ovako, posle reloga nemoze da ti se sacuva Fighting Stajl!!! KapiraS?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)