Skip to content
  • 0 Unread 0
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
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 351 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
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
    • Scriptoundefined Scripto

      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 Offline
      Kizzy2DDundefined Offline
      Kizzy2DD
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

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