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; }
Originally Posted by dice7
It's the same if you use FIGHT_STYLE_NORMAL or 4
|
if (strcmp(cmdtext, "/boxing", true) == 0)
{
SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING);
SendClientMessage(playerid, purple, ">> Fighting Style changed to 'Boxer'");
return 1;
}
if(strcmp(cmd, "/kungfu", true) == 0)
{
SetPlayerFightingStyle(playerid, FIGHT_STYLE_KUNGFU);
SendClientMessage(playerid, purple, ">> Fighting Style changed to 'Kung-Fu'");
return 1;
}
if (strcmp(cmdtext, "/kungfu", true) == 0) { SetPlayerFightingStyle (playerid, FIGHT_STYLE_KUNGFU); SendClientMessage(playerid, COLOR_LIGHTGREEN, "Fighting Style changed to Kung-Fu"); return 1; }
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; } |
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;
}