Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new Tiros[MAX_PLAYERS];
- new Faleceu[MAX_PLAYERS];
- public OnPlayerConnect(playerid)
- {
- Tiros[playerid] = 0;
- Faleceu[playerid] = 0;
- }
- 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",4.1,0,1,1,0,0,1);
- Tiros[damagedid] = 0;
- }
- if(weaponid == 24 || weaponid == 25 || weaponid == 27)
- {
- Tiros[damagedid]++;
- if(Tiros[damagedid] > 4)
- {
- ApplyAnimation(damagedid,"PED","DAM_STOMACH_FRMFT",4.1,0,1,1,0,0,1);
- Tiros[damagedid] = 0;
- }
- }
- if(weaponid == 29 || weaponid == 30 || weaponid == 31)
- {
- Tiros[damagedid]++;
- if(Tiros[damagedid] > 9)
- {
- ApplyAnimation(damagedid,"PED","DAM_STOMACH_FRMFT",4.1,0,1,1,0,0,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);
- if(Vida < amount/2)
- {
- ChamarDeath(damagedid,playerid,weaponid);
- Faleceu[damagedid] = 1;
- SetTimerEx("SairFalecer",1000,0,"i",damagedid);
- }
- }
- return 1;
- }
- SairFalecer(playerid);
- public SairFalecer(playerid)
- {
- Faleceu[playerid] = 0;
- }
- ChamarDeath(playerid,killerid,reason) // OBS: Colocado aqui para não dar erros com a identação
- {
- CallRemoteFunction("OnPlayerDeath","iii",playerid,killerid,reason);
- SetPlayerHealth(playerid,0.0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement