06.03.2014, 04:21
Thank you for the tutorial! You could have just make this to simplify the whole idea.
And making the public even shorter -
PHP код:
CMD:walkstyle(playerid, params[])
{
if(strval(params) < 1 || strval(params) > 11)
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /walkstyle [1-11]");
SetPlayerWalkingStyle(playerid, strval(params));
return 1;
}
PHP код:
forward WalkAnim(playerid);
public WalkAnim(playerid)
{
new keys, updown, leftright;
GetPlayerKeys(playerid,keys,updown,leftright);
if ((keys & KEY_WALK && updown & KEY_UP) || (keys & KEY_WALK && updown & KEY_DOWN) || (keys & KEY_WALK && leftright & KEY_LEFT) || (keys & KEY_WALK && leftright & KEY_RIGHT))
{
KillTimer(walktime[playerid]);
switch(GetPlayerWalkingStyle(playerid))
{
case 1: ApplyAnimation(playerid,"PED","WALK_player",4.1,1,1,1,1,1);
case 2: ApplyAnimation(playerid,"PED","WALK_civi",4.1,1,1,1,1,1);
case 3: ApplyAnimation(playerid,"PED","WALK_gang1",4.1,1,1,1,1,1);
case 4: ApplyAnimation(playerid,"PED","WALK_gang2",4.1,1,1,1,1,1);
case 5: ApplyAnimation(playerid,"PED","WALK_old",4.1,1,1,1,1,1);
case 6: ApplyAnimation(playerid,"PED","WALK_fatold",4.1,1,1,1,1,1);
case 7: ApplyAnimation(playerid,"PED","WALK_fat",4.1,1,1,1,1,1);
case 8: ApplyAnimation(playerid,"PED","WOMAN_walknorm",4.1,1,1,1,1,1);
case 9: ApplyAnimation(playerid,"PED","WOMAN_walkbusy",4.1,1,1,1,1,1);
case 10: ApplyAnimation(playerid,"PED","WOMAN_walkpro",4.1,1,1,1,1,1);
case 11: ApplyAnimation(playerid,"PED","WOMAN_walksexy",4.1,1,1,1,1,1);
case 12: ApplyAnimation(playerid,"PED","Walk_Wuzi",4.1,1,1,1,1,1);
default: ClearAnimations(playerid);
}
walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid);
}
return true;
}