Sign in to follow this  
Followers 0
DEST

Стрельба по скину и антиGM

1 post in this topic

Многие знают, что в CRMP 0.3e, да и в ранних версиях, стрельба идет исключительно по пингу. Т.е. стрелять нужно немного вперед. Данный код сделает систему стрельбы по скину. 

public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
    new Float: vida, Float: armadura, Float: dmg;
    GetPlayerArmour(damagedid, armadura);
    GetPlayerHealth(damagedid, vida);
    if(armadura > 0)
    {
        if(amount > armadura)
        {
            dmg = amount - armadura;
            vida = vida - dmg;
            SetPlayerArmour(damagedid, 0.0);
            SetPlayerHealth(damagedid, vida);
            return 1;
        }
        armadura = armadura - amount;
        SetPlayerArmour(damagedid, armadura);
    }
    if(armadura < 1)
    {
        vida = vida - amount;
        SetPlayerHealth(damagedid, vida);
    }
    return true;
}

Автор: iDx420 aka Ari3l

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • Артем Гудков
      By Артем Гудков
      Запускаю сервер, выходит такая ошибка. Мод сервера black russia, по названию ошибки понял что сервер надо запускать на debian или что-то типо этой