Odporność na moc klasy
Klakier
03.04.2012
Witam,
jak zrobić, aby nie zabijało się swoich kolegów z teamu mocą danej klasy np rakietką. We wsparciu ogniowym jest takie coś:
A jak to zrobić gdy mamy takie coś:
jak zrobić, aby nie zabijało się swoich kolegów z teamu mocą danej klasy np rakietką. We wsparciu ogniowym jest takie coś:
if (!is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid)) rowny teamowi obrywajacego to idziemy dalej
continue;
A jak to zrobić gdy mamy takie coś:
if( pev( pEntity, pev_takedamage ) != DAMAGE_NO )
{
// Check if this is player and player on team
if( is_user_valid_connected( pEntity ))
{
// Retrieve health
static iHealth
iHealth = get_user_health( pEntity )
// We should be alive
if( iHealth - flDamage >= 1 )
{
// Cause some damage
ExecuteHamB( Ham_TakeDamage, pEntity, 0, Player, flDamage, DMG_BULLET | DMG_ALWAYSGIB )
}
else
{
// Die
g_bKilledByLaser[ pEntity ] = true
ExecuteHamB( Ham_Killed, pEntity, Player, 2 )
g_bKilledByLaser[ pEntity ] = false
}
}
Klakier
03.04.2012
ff jest wyłączone a i tak można zabić kolege ze swojego teamu np. rakietka
A może sma?
04.04.2012
if(pev(pEntity, pev_takedamage) != DAMAGE_NO)
{
if(is_user_valid_connected(pEntity))
{
if(get_user_team(pEntity) == get_user_team(Player))
return;
static iHealth
iHealth = get_user_health( pEntity )
if( iHealth - flDamage >= 1 )
{
ExecuteHamB(Ham_TakeDamage, pEntity, 0, Player, flDamage, DMG_BULLET | DMG_ALWAYSGIB)
}
else
{
g_bKilledByLaser[pEntity] = true
ExecuteHamB( Ham_Killed, pEntity, Player, 2)
g_bKilledByLaser[pEntity] = false
}
}
}