SA-MP Forums Archive
why dont my fight command work? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: why dont my fight command work? (/showthread.php?tid=95723)



why dont my fight command work? - [mad]MLK - 04.09.2009

it dose nothing ?
Код:
dcmd_fightstyle(playerid,params[])
{
 if(!params[0]) return SendClientMessage(playerid, 0x00FF00AA, "Example: /fightstyle [4 - 26]");

 new fightstyle = strval(params);

 for(new i = 0; i < MAX_PLAYERS; i++)
 {
  if(IsPlayerConnected(i))
  {
   SetPlayerFightingStyle(i, fightstyle);
  }
 }

 return 1;
}



Re: why dont my fight command work? - eminich - 04.09.2009

There are only three fighting styles.


Re: why dont my fight command work? - [mad]MLK - 04.09.2009

no there isent
https://sampwiki.blast.hk/wiki/Fightingstyles


Re: why dont my fight command work? - Balon - 04.09.2009

Yes, it does. It sets fighting style for all connected players.


Re: why dont my fight command work? - kc - 04.09.2009

it probably does work.

Remember back to single player, you will find the answer.


Re: why dont my fight command work? - (.Aztec); - 04.09.2009

4 - FIGHT_STYLE_NORMAL
5 - FIGHT_STYLE_BOXING
6 - FIGHT_STYLE_KUNGFU
7 - FIGHT_STYLE_KNEEHEAD
15 - FIGHT_STYLE_GRABKICK
26 - FIGHT_STYLE_ELBOW

You have to use the following: "SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING);", Not an ID as far as I remember.


Re: why dont my fight command work? - dice7 - 04.09.2009

It's the same if you use FIGHT_STYLE_NORMAL or 4


Re: why dont my fight command work? - (.Aztec); - 05.09.2009

Quote:
Originally Posted by dice7
It's the same if you use FIGHT_STYLE_NORMAL or 4
My bar, I just use seperate commands, such as:

pawn Код:
if (strcmp(cmdtext, "/boxing", true) == 0)
    {
        SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING);
      SendClientMessage(playerid, purple, ">> Fighting Style changed to 'Boxer'");
      return 1;
    }
pawn Код:
if(strcmp(cmd, "/kungfu", true) == 0)
{
      SetPlayerFightingStyle(playerid, FIGHT_STYLE_KUNGFU);
      SendClientMessage(playerid, purple, ">> Fighting Style changed to 'Kung-Fu'");
      return 1;
    }
Edit: I blame firefox for my poor indentation.


Re: why dont my fight command work? - Stas92 - 10.09.2009

The fighting styles don't work for me. I have copied the command in the samp wiki:
Код:
if (strcmp(cmdtext, "/kungfu", true) == 0)
	{
  	SetPlayerFightingStyle (playerid, FIGHT_STYLE_KUNGFU);
  	SendClientMessage(playerid, COLOR_LIGHTGREEN, "Fighting Style changed to Kung-Fu");
  	return 1;
	}
But the player is stil using cj's fighting style?


Re: why dont my fight command work? - Kyosaur - 10.09.2009

Quote:
Originally Posted by Stas92
The fighting styles don't work for me. I have copied the command in the samp wiki:
Код:
if (strcmp(cmdtext, "/kungfu", true) == 0)
	{
  	SetPlayerFightingStyle (playerid, FIGHT_STYLE_KUNGFU);
  	SendClientMessage(playerid, COLOR_LIGHTGREEN, "Fighting Style changed to Kung-Fu");
  	return 1;
	}
But the player is stil using cj's fighting style?
Same Thing with me. The only time i actually see this function work is after i stop punching, then my character gets into the correct stance (eg a boxing stance). Other than that, my fighting style always looks "normal" :\.


Here's my command:

pawn Код:
dcmd_fight(playerid, params[])
{
    new Style, FightName[15];
   
    if(!sscanf(params, "i", Style))
    {
        if(Style >= 1 && Style <= 6)
        {
            switch(Style)
          {
            case 1: {Style = 4, FightName = "Normal";}
            case 2: {Style = 5, FightName = "Boxing";}
            case 3: {Style = 6, FightName = "KungFu";}
            case 4: {Style = 7, FightName = "KneeHead";}
            case 5: {Style = 15, FightName = "GrabKick";}
            case 6: {Style = 26, FightName = "Elbow";}
            }
            SetPlayerFightingStyle(playerid, Style);
            format(String, sizeof(String), "Your new fighting style is %s",FightName);
            SendClientMessage(playerid, white, String);
            return 1;
        }
        else
        {
          SendClientMessage(playerid, red, "Error: /Fight <1-6>");
          return 1;
        }
    }
    else
    {
      SendClientMessage(playerid, red, "Error: /Fight <1-6>");
    }
    return 1;
}