07.11.2018, 21:49
Queria saber como faзo para diminuir o dano da minigun para 0.5 ou 1 cada tiro, mas nгo sei como fazer.
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);
}