Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. make a distance meter hud?

make a distance meter hud?

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
2 Posts 2 Posters 130 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Scriptoundefined Offline
    Scriptoundefined Offline
    Scripto
    wrote on last edited by
    #1

    I'm trying to make a distance meter HUD where when someone hits its says their name plus the player they killed and then their distance. i have this so far O_O

    
    Callback_PlayerDamageHook( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, boneindex ) 
    {
    	self endon( "disconnect" );
    
    	OnGround = eattacker IsOnGround();
    	IsClose = Distance( self.origin, eattacker.origin ) < 500;
    	meterdist = int( Distance( self.origin, eattacker.origin ) / 39.37 );
    
    	if( smeansofdeath != "MOD_TRIGGER_HURT" && smeansofdeath != "MOD_FALLING" && smeansofdeath != "MOD_SUICIDE" ) 
    	{
    		if( isDefined(eattacker.dontkill) )
    			self.health += idamage;
    		else if( !OnGround && isDefined(eattacker.customweapon) && IsSubStr( sweapon, self.customweapon ) && meterdist > 15 )
    			idamage = 10000000;
    		else if( smeansofdeath == "MOD_MELEE" || IsSubStr( sweapon, "+gl" ))
    			self.health += idamage;
    		else if( einflictor != eattacker && sweapon == "hatchet_mp" )
    			self.health += idamage;
    		else if( einflictor != eattacker && sweapon == "knife_ballistic_mp" )
    			self.health += idamage;
    		else if( OnGround )
    			self.health += idamage;
    		else if( getWeaponClass( sweapon ) == "weapon_sniper" || IsSubStr( sweapon, "sa58" ) || IsSubStr( sweapon, "saritch" ) )
    		{
    			if( meterdist < 5 )
    			{
    				self.health += idamage;
    				eattacker iprintln("^5Barrel Stuff Protection! ^1Hitmarkered ^5from ( ^1"+meterdist+" ^5) meters away!" );
    			}
    			else
    				idamage = 10000000;
    		}
    		else
    			self.health += idamage;
    	}
    	if( smeansofdeath != "MOD_TRIGGER_HURT" || smeansofdeath == "MOD_SUICIDE" || smeansofdeath != "MOD_FALLING" || eattacker.classname == "trigger_hurt" ) 
    		self.attackers = undefined;
    	[[level.playerDamageStub]]( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, boneindex );
    	if( idamage == 10000000 && level.scorelimit == eattacker.pers["pointstowin"] )
    	{
    		if( !isDefined(level.meters) )
    		{
    			level.meters = true;
    			eattacker.biller = true;
    			foreach( player in level.players )
    for(;;)
    {
    level waittill("final_killcam_done");
    			
    				level.infoHud = level createServerText( "default" + getPlayerName() + "Hit:" + self.name + "("+meterColor(meterdist)+" "+meterdist+" ^7) meters away!" );
    			}
    		}
    	}```
    I have 0 clue what to do from this point.
    Kizzy2DDundefined 1 Reply Last reply
    1
    • Kizzy2DDundefined Offline
      Kizzy2DDundefined Offline
      Kizzy2DD
      replied to Scripto on last edited by
      #2

      @Anti-Scripto how do i set this up to play in-game?

      1 Reply Last reply
      0

      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Donate