new Tiros[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
Tiros[playerid] = 0;
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerTeam(playerid,1);
return 1;
}
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 0;
}
Colete = Colete - amount/2;
SetPlayerArmour(damagedid,Colete);
}
if(Colete < 1)
{
Vida = Vida - amount/2;
SetPlayerHealth(damagedid,Vida);
}
return 0;
}