pawn Код:
new Shield[MAX_PLAYERS];
new WithShield[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/shield", cmdtext, true, 10) == 0)
{
if(WithShield[playerid] == 0)
{
ApplyAnimation(playerid,"SWORD","sword_block",50.0,0,1,1,1,1);
Shield[playerid] = CreateObject(1533,2470.573,-1660.366,14.271,0.0,0.0,-90.000);
AttachObjectToPlayer(Shield[playerid],playerid,-0.8,0.5,-1.65,0.0,0,0.0);
ApplyAnimation(playerid,"SWORD","sword_block",50.0,0,1,1,1,1);
DestroyObject(Shield[playerid]);
SetTimerEx("SAnim", 500, 0, "i", playerid);
WithShield[playerid] = 1;
return 1;
}
else if(WithShield[playerid] == 1)
{
DestroyObject(Shield[playerid]);
SendClientMessage(playerid,ROJO,"You have dropped the shield.");
ClearAnimations(playerid);
WithShield[playerid] = 0;
return 1;
}
}
return 0;
}
forward SAnim(playerid);
public SAnim(playerid)
{
ApplyAnimation(playerid,"SWORD","sword_block",50.0,0,1,1,1,1);
return 1;
}