29.11.2009, 13:56
Here you go mate, i added the PlayerInfo, make sure you have the Fight styles loading on OnPlayerLogin and creating OnPlayerRegister & Update though you will have to make functions like
Put this under public OnPlayerCommandText
And this public OnDialogResponse
pawn Код:
forward fightstyle_Boxing(playerid);
public fightstyle_Boxing(playerid)
{
SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING);
}
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/fightstyle", cmdtext, true, 11) == 0)
{
ShowPlayerDialog(playerid, 1234, DIALOG_STYLE_LIST, "Fighting Style", "Elbow\nBoxing\nGrabkick\nKneehead\nKungfu\nNormal", "Learn", "Cancel");
return 1;
}
return 0;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1234)
{
if(response)
{
if(listitem == 0)
{
SetPlayerFightingStyle(playerid, FIGHT_STYLE_ELBOW);
SendClientMessage(playerid, 0xFFFFFFFF, "You've learned fighting style 'Elbow'");
PlayerInfo[playerid][elbow] = 1;
PlayerInfo[playerid][boxing] = 0;
PlayerInfo[playerid][kneehead] = 0;
PlayerInfo[playerid][grabkick] = 0;
PlayerInfo[playerid][KungFu] = 0;
PlayerInfo[playerid][normal] = 0;
}
if(listitem == 1)
{
SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING);
SendClientMessage(playerid, 0xFFFFFFFF, "You've learned fighting style 'Boxing'");
PlayerInfo[playerid][elbow] = 0;
PlayerInfo[playerid][boxing] = 1;
PlayerInfo[playerid][kneehead] = 0;
PlayerInfo[playerid][grabkick] = 0;
PlayerInfo[playerid][KungFu] = 0;
PlayerInfo[playerid][normal] = 0;
}
if(listitem == 2)
{
SetPlayerFightingStyle(playerid, FIGHT_STYLE_GRABKICK);
SendClientMessage(playerid, 0xFFFFFFFF, "You've learned fighting style 'Grabkick'");
PlayerInfo[playerid][elbow] = 0;
PlayerInfo[playerid][boxing] = 0;
PlayerInfo[playerid][kneehead] = 0;
PlayerInfo[playerid][grabkick] = 1;
PlayerInfo[playerid][KungFu] = 0;
PlayerInfo[playerid][normal] = 0;
}
if(listitem == 3)
{
SetPlayerFightingStyle(playerid, FIGHT_STYLE_KNEEHEAD);
SendClientMessage(playerid, 0xFFFFFFFF, "You've learned fighting style 'KNEEHEAD'");
PlayerInfo[playerid][elbow] = 0;
PlayerInfo[playerid][boxing] = 0;
PlayerInfo[playerid][kneehead] = 1;
PlayerInfo[playerid][grabkick] = 0;
PlayerInfo[playerid][KungFu] = 0;
PlayerInfo[playerid][normal] = 0;
}
if(listitem == 4)
{
SetPlayerFightingStyle(playerid, FIGHT_STYLE_KUNGFU);
SendClientMessage(playerid, 0xFFFFFFFF, "You've learned fighting style 'KUNGFU'");
PlayerInfo[playerid][elbow] = 0;
PlayerInfo[playerid][boxing] = 0;
PlayerInfo[playerid][kneehead] = 0;
PlayerInfo[playerid][grabkick] = 0;
PlayerInfo[playerid][KungFu] = 1;
PlayerInfo[playerid][normal] = 0;
}
if(listitem == 5)
{
SetPlayerFightingStyle(playerid, FIGHT_STYLE_NORMAL);
SendClientMessage(playerid, 0xFFFFFFFF, "You've learned fighting style 'Normal'");
PlayerInfo[playerid][elbow] = 0;
PlayerInfo[playerid][boxing] = 0;
PlayerInfo[playerid][kneehead] = 0;
PlayerInfo[playerid][grabkick] = 0;
PlayerInfo[playerid][KungFu] = 0;
PlayerInfo[playerid][normal] = 1;
}
}
}
return 1;
}