why dont my fight command work?
#1

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;
}
Reply
#2

There are only three fighting styles.
Reply
#3

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

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

it probably does work.

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

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.
Reply
#7

It's the same if you use FIGHT_STYLE_NORMAL or 4
Reply
#8

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.
Reply
#9

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?
Reply
#10

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;
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)