Setting Fighting Style. - 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: Setting Fighting Style. (
/showthread.php?tid=372963)
Setting Fighting Style. -
nogh445 - 28.08.2012
This is the command and there are no warnings or errors but when I get in game and do the command it doesn't seem to set the players fighting style.
pawn Код:
CMD:setfightstyle(playerid, params[])
{
new targetid, style, string[128];
if(PlayerInfo[playerid][Admin] >=3)
{
if(sscanf(params, "ui", targetid, style)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /setfightstyle [id] [styleid]");
if( targetid != INVALID_PLAYER_ID )
{
SetPlayerFightingStyle(targetid, style);
format(string, sizeof(string),"Administrator %s has set your fighting style to id %d",pName(playerid), style);
SendClientMessage(targetid,COLOR_RED,string);
format(string, sizeof(string),"You have set %s's fighting style to id %d",pName(targetid), style);
SendClientMessage(playerid,COLOR_RED,string);
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Only certan levels of Administration have access to this command.");
}
return 1;
}
Re: Setting Fighting Style. -
ThePhenix - 28.08.2012
Just see at fighting styles:
PHP код:
if(dialogid == DIALOGID+81)
{
if(response)
{
if(listitem == 0)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_ELBOW);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~g~Elbow ~w~Style Changed!",2000,3);
}
if(listitem == 1)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_BOXING);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~g~Boxing ~w~Style Changed!",2000,3);
}
if(listitem == 2)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_GRABKICK);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~g~Grabkick ~w~Style Changed!",2000,3);
}
if(listitem == 3)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_KNEEHEAD);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~g~Nheehead ~w~Style Changed!",2000,3);
}
if(listitem == 4)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_KUNGFU);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~g~KungFu ~w~Style Changed!",2000,3);
}
if(listitem == 5)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_NORMAL);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~g~Normal ~w~Style Changed!",2000,3);
}
}
return 1;
}
Re: Setting Fighting Style. -
RenSoprano - 28.08.2012
pawn Код:
CMD:setfightstyle(playerid, params[])
{
new targetid, style, string[128];
if(PlayerInfo[playerid][Admin] >=3)
{
if(sscanf(params, "ud", targetid, style)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /setfightstyle [id] [4, 5, 6, 7, 15, 26]");
if( targetid != INVALID_PLAYER_ID )
{
if(style > 3 && style < 8 || style == 15 || style == 26)
{
SetPlayerFightingStyle(targetid, style);
format(string, sizeof(string),"Administrator %s has set your fighting style to id %d",pName(playerid), style);
SendClientMessage(targetid,COLOR_RED,string);
format(string, sizeof(string),"You have set %s's fighting style to id %d",pName(targetid), style);
SendClientMessage(playerid,COLOR_RED,string);
SetPlayerFightingStyle(giveplayerid, style);
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Only certan levels of Administration have access to this command.");
}
return 1;
}