If i want to start a trickshot server how do I add barrel stuff protection and other features that are on other trickshot servers

Topic created · 7 Posts · 169 Views
  • If i want to start a trickshot server how do I add barrel stuff protection and other features that are on other trickshot servers

  • I used to be like this a year ago, so I'd feel bad if I didn't help out.
    But if I help you out, please learn GSC. It's nice to know and I learned it over the course of 2020 and I can type it away like it's nothing now.

    This works for the DSR50, and if you are not on last and you are close, it will do damage. But if you are on last and you are close, it won't do damage.

    Add this to init()

    level.playerDamageStub = level.callbackplayerdamage;
    level.callbackplayerdamage = ::Callback_PlayerDamageHook;
    

    Add this function anywhere in your code:

    Callback_PlayerDamageHook( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, boneindex) {
     
        IsClose = Distance( self.origin, eattacker.origin ) < 400; // barrel stuff
        OnLast = (level.scorelimit - attacker.pers["kills"]) == 1;
     
        if( smeansofdeath != "MOD_TRIGGER_HURT" && smeansofdeath != "MOD_FALLING" && smeansofdeath != "MOD_SUICIDE" ) {
            if( IsSubStr( sweapon, "dsr50" ) && IsClose ) {
                if (OnLast)
                    idamage = 0;
                else
                    idamage = 10000000;
            else
                idamage = 0;
        }
    
        [[level.playerDamageStub]]( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, boneindex );
    }
    
  • @mikey Thanks so much means alot

  • @Kajuiz
    if you care just about sniper don't use IsSubStr just use GetWeaponClass( sWeapon ), will work with all snipers

    Callback_PlayerDamageHook( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, boneindex) {
     
        IsClose = Distance( self.origin, eattacker.origin ) < 400; // barrel stuff
        OnLast = (level.scorelimit - attacker.pers["kills"]) == 1;
     
        if( smeansofdeath != "MOD_TRIGGER_HURT" && smeansofdeath != "MOD_FALLING" && smeansofdeath != "MOD_SUICIDE" ) {
            if(  !IsClose && GetWeaponClass( sweapon ) == "weapon_sniper" ) {
                if (OnLast)
                    idamage = 0;
                else
                    idamage = 9999; 
            else
                idamage = 0;
        }
    
        [[level.playerDamageStub]]( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, boneindex );
    }
    
  • @Sorex i used to do this but I changed my way of doing it to do stuff with specific weapons, like altering a XPR or SVU spraying.

  • @mikey No XPR and SVU spraying damage can be a good solution. Is easy to make. I have to implement it on my servers. But is not to hard to make.
    XPR and SVU are cool snipers for trickshot i like it

  • hey im reading this as I want to start a trickshotting server, but I don't know where to put all of the scripts ect. Is it okay if somebody could hop on a discord call with me and help me please?

Log in to reply