30.10.2013, 17:48
pawn Код:
new Tiros[Maximo_Players];
public OnPlayerGiveDamage(playerid,damagedid,Float:amount,weaponid)
{
new Float:Vida; new Float:Colete; new Float:Dano; new Fala[20];
if(weaponid == 16 || weaponid == 34 || weaponid == 35 || weaponid == 38)
{
ApplyAnimation(damagedid,"PED","DAM_STOMACH_FRMFT",5.0,0,1,1,1,1,1);
Tiros[damagedid] = 0;
}
if(weaponid == 24 || weaponid == 25 || weaponid == 27)
{
Tiros[damagedid]++;
if(Tiros[damagedid] > 4)
{
ApplyAnimation(damagedid,"PED","DAM_STOMACH_FRMFT",5.0,0,1,1,1,1,1);
Tiros[damagedid] = 0;
}
}
if(weaponid == 29 || weaponid == 30 || weaponid == 31)
{
Tiros[damagedid]++;
if(Tiros[damagedid] > 9)
{
ApplyAnimation(damagedid,"PED","DAM_STOMACH_FRMFT",5.0,0,1,1,1,1,1);
Tiros[damagedid] = 0;
}
}
GetPlayerArmour(damagedid,Colete);
GetPlayerHealth(damagedid,Vida);
PlayerPlaySound(playerid,1131,0.0,0.0,0.0);
PlayerPlaySound(damagedid,17802,0.0,0.0,0.0);
format(Fala,sizeof(Fala),"~r~-%0.0f",amount/2);
GameTextForPlayer(damagedid,Fala,1000,3);
if(Colete > 0)
{
if(amount/2 > Colete)
{
Dano = amount/2 - Colete;
Vida = Vida - Dano;
SetPlayerArmour(damagedid,0.0);
SetPlayerHealth(damagedid,Vida);
return 1;
}
Colete = Colete - amount/2;
SetPlayerArmour(damagedid,Colete);
}
if(Colete < 1)
{
Vida = Vida - amount/2;
SetPlayerHealth(damagedid,Vida);
}
return 1;
}
Porйm ele estб com um pequeno problema:
Quando o jogador leva alguns tiros, a animaзao ApplyAnimation(damagedid,"PED","DAM_STOMACH_FRMFT" ,5.0,0,1,1,1,1,1); й chamada.
No entanto ela buga o jogador e para desbugar o mesmo precisa pular ou mirar. O problema й este: 0,1,1,1,1,1.
Porйm, qual й a ordem correta dos mesmos ?
Obrigado!