Tem que fazer uma gambiarra com OnPlayerGiveDamage fazendo a verificaзгo da arma e diminuindo o valor da vida.
|
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
new Float:life;
GetPlayerHealth(playerid, life);
switch(weaponid)
{
case 35:
{
SetPlayerHealth(playerid, life-50);
}
}
return 1;
}
#include <a_samp>
new PlayerTeam[MAX_PLAYERS];
public OnPlayerSpawn(playerid){
SetPlayerTeam(playerid, 0);
PlayerTeam[playerid] = 0;
return 1;
}
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
// Caso tente matar mesma gang
if(PlayerTeam[playerid] == PlayerTeam[damagedid]){
return 0;
}
new Float:life;
GetPlayerHealth(damagedid, life);
switch(weaponid)
{
case 35:
{
SetPlayerHealth(damagedid, life-0.5);
}
}
return 1;
}
// Usar isso no lugar de SetPlayerTeam
stock SetPlayerServerTeam(playerid, teamid){
return PlayerTeam[playerid] = teamid;
}
// Usar isso no lugar de GetPlayerTeam
stock GetPlayerServerTeam(playerid){
return PlayerTeam[playerid];
}
new Float:HP;
new Float:Armor;
GetPlayerArmour(damagedid, Armor);
GetPlayerHealth(damagedid, HP);
if(Armor < 1)
{
if(weaponid == 38) SetPlayerHealth(damagedid, HP+amount-46.5);
if(Armor <= 100)
{
if(weaponid == 38) SetPlayerArmour(damagedid, Armor+amount-46.5);
}