pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_JUMP)
{
if(WithShield[playerid] == 1)
{
new Float: X, Float: Y, Float: Z;
GetPlayerPos(playerid,X,Y,Z);
SetPlayerPos(playerid,X,Y,Z);
ApplyAnimation(playerid,"SWORD","sword_block",50.0,0,1,1,1,1);
SetTimerEx("SAnim", 500, 0, "i", playerid);
}
}
if(newkeys == KEY_FIRE)
{
if(WithShield[playerid] == 1)
{
ApplyAnimation(playerid,"SWORD","sword_block",50.0,0,1,1,1,1);
SetTimerEx("SAnim", 500, 0, "i", playerid);
}
}
if(newkeys == KEY_CROUCH)
{
if(WithShield[playerid] == 1)
{
new Float: X, Float: Y, Float: Z;
GetPlayerPos(playerid,X,Y,Z);
SetPlayerPos(playerid,X,Y,Z);
ApplyAnimation(playerid,"SWORD","sword_block",50.0,0,1,1,1,1);
SetTimerEx("SAnim", 500, 0, "i", playerid);
}
}
if(newkeys == KEY_SECONDARY_ATTACK)
{
if(WithShield[playerid] == 1)
{
WithShield[playerid] = 0;
DestroyObject(Shield[playerid]);
SendClientMessage(playerid,ROJO,"You have dropped the shield.");
ClearAnimations(playerid);
}
}
return 1;
}