17.02.2012, 17:57
I have make cmd for change walkstyle but how can i make when i press Alt so he walking to that walkstyle i change to?
UsePlayerPedAnims();
#define HOLDING(%0) ((newkeys & (%0)) == (%0))
#define RELEASED(%0) (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new udlr, ud, lr;
GetPlayerKeys(playerid, udlr, ud, lr);
if(HOLDING(KEY_WALK) && ud > 0 || HOLDING(KEY_WALK) && ud < 0 || HOLDING(KEY_WALK) && lr > 0 || HOLDING(KEY_WALK) && lr < 0) {
// Once a player presses ALT and one of the arrows.
} else if(RELEASED(KEY_WALK)) {
// Once a player releases ALT.
}
return 1;
}
ApplyAnimation > Animations Then Ctrl + F and write on the search box "walk" and press Enter.
It has 56 results. |
}
if(strcmp(x_nr,"1",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREEN, "USAGE: /setstyle 1 [StyleID]");
SendClientMessage(playerid, COLOR_WHITE, "Walk Styles: 1,2,3,4,5,6,7,8,9");
SendClientMessage(playerid, COLOR_WHITE, "Walk Styles: 10,11,12,13,14,15,16");
SendClientMessage(playerid, COLOR_WHITE, "Walk Styles: 17,18");
return 1;
}
new walkstyle;
walkstyle = strval(tmp);
if(walkstyle < 1 || walkstyle > 18)
{
return 1;
}
if(walkstyle > 2 && PlayerInfo[playerid][pDonator] == 0)
{
SendClientMessage(playerid,COLOR_GREY," This is a donator feature only !");
return 1;
}
PlayerInfo[playerid][pWalk] = walkstyle;
format(string, sizeof(string), "You have set your walking style to: %d", walkstyle);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;