public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
if(weaponid == WEAPON_SNIPER)
{
// CODE
}
return 1;
}
|
OnPlayerGiveDamage
Dentro desta callback crie uma condicional com o parвmetro weaponid e dentro dessa condicional faz o que vc quer... @edit Nгo vн que era pedido... Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
if(weaponid == WEAPON_SNIPER)
{
// CODE
}
return 1;
}
Tente fazer, se precisar de ajuda, poste. |
|
A funзгo de remover vida e colete do jogador.
Quero que tente fazer e poste o resultado. Mesmo o prefixo sendo Pedido, й bom tentar raciocinar um pouco. |
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
if(weaponid == WEAPON_SNIPER)
{
new Float:Life;
GetPlayerHealth(playerid,health);
SetPlayerHealth(damageid,Life - 100);
}
return 1;
}
|
Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
if(weaponid == WEAPON_SNIPER)
{
new Float:Life;
GetPlayerHealth(playerid,health);
SetPlayerHealth(damageid,Life - 100);
}
return 1;
}
|
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
if(weaponid == WEAPON_SNIPER)
{
new Float:Colete, Float:Vida;
GetPlayerArmour(damagedid, Colete);
if(Colete > 0)
{
GetPlayerHealth(damagedid, Vida);
SetPlayerArmour(damagedid, 0.0);
SetPlayerHealth(damagedid, Vida - 50);
}
else
{
SetPlayerHealth(damagedid, 0.0);
}
}
return 1;
}