Перейти к содержимому
View in the app

A better way to browse. Learn more.

Zloplay community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Line of code for crosshairs!

Featured Replies

Опубликовано:
Connected to the crosshair, does anyone know the dvar to change the hitmarker color? In hardcore mode, when you hit an enemy, you can see a white cross. I want to change the color into red.

viewtopic.php?f=42&t=11603

Release #5

 

That release works just for the client who has that inside.

 

If i put that damage_feedback.iwi inside the iw01 of the dedicated server, it doesn't change the color of the "hit cross".

 

Other options?

 

Thanks anyway

Опубликовано:
Okay i know the line of code to change the crosshairs, But im not sure where it goes. Im adding it too boots freedom mod, but i cant find where to add it in to the rank_.gsc

 

You need to give the steady aim perk and change the spread multiplier dvar, so you should have two lines actually.

Anyway, _rank.gsc doesn't have any mystic powers, so you don't necessarily have to put it there.

 

You could do it like this:

 

find the onplayerspawned() function and and add setDvars();, so that it look like this:

onPlayerSpawned()
{
self endon( "disconnect" );
for(;
{
	self waittill( "spawned_player" );

	self setDvars();
}
}

setDvars()
{
self maps\mp\perks\_perks::givePerk( "specialty_fastreload" );
self setClientDvar( "perk_weapSpreadMultiplier", 0.55 );
}

 

That release works just for the client who has that inside.

If i put that damage_feedback.iwi inside the iw01 of the dedicated server, it doesn't change the color of the "hit cross".

 

Other options?

 

Thanks anyway

 

Get a clean _damagefeedback.gsc (e.g. here: viewtopic.php?f=17&t=8768 ) and find the updateDamageFeedback( typeHit ) function,

change it so it looks like this:

updateDamageFeedback( typeHit )
{
if ( !isPlayer( self ) )
	return;

x = -12;
y = -12;

if ( getDvarInt( "camera_thirdPerson" ) )
	yOffset = self GetThirdPersonCrosshairOffset() * 240;
else
	yOffset = getdvarfloat( "cg_crosshairVerticalOffset" ) * 240;

if ( level.splitscreen )	
	yOffset *= 0.5;

feedbackDurationOverride = 0;
startAlpha = 1;

if ( typeHit == "hitBodyArmor" )
{
	self.hud_damagefeedback setShader("damage_feedback_j", 24, 48);
	//red color
	self.hud_damagefeedback.color = ( 1, 0, 0 );
	self playlocalsound("MP_hit_alert"); // TODO: change sound?
}
else if ( typeHit == "hitEndGame" )
{
	self.hud_damagefeedback setShader("damage_feedback_endgame", 24, 48);
	//red color
	self.hud_damagefeedback.color = ( 1, 0, 0 );
	self playlocalsound("MP_hit_alert");
}
else if ( typeHit == "stun" )
{
	return;	
}
else if ( typeHit == "none" )
{
	return;	
}
else if ( typeHit == "scavenger" && !level.hardcoreMode )
{
	x = -36;
	y = 32;
	self.hud_damagefeedback setShader("scavenger_pickup", 64, 32);
	//scavenger color white
	self.hud_damagefeedback.color = ( 1, 1, 1 );
	feedbackDurationOverride = 2.5;
}
else
{
	self.hud_damagefeedback setShader("damage_feedback", 24, 48);

	//red color
	self.hud_damagefeedback.color = ( 1, 0, 0 );
	self playlocalsound("MP_hit_alert");
}

self.hud_damagefeedback.alpha = startAlpha;
if ( feedBackDurationOverride != 0 )
	self.hud_damagefeedback fadeOverTime(feedbackDurationOverride);
else	
	self.hud_damagefeedback fadeOverTime(1);

self.hud_damagefeedback.alpha = 0;

// only update hudelem positioning when necessary
if ( self.hud_damagefeedback.x != x )
	self.hud_damagefeedback.x = x;	

y = y - int( yOffset );
if ( self.hud_damagefeedback.y != y )
	self.hud_damagefeedback.y = y;	
}

 

result:

RsvuD.jpg

Опубликовано:
Thanks Banz!!! Works perfectly!!!!

 

I've just noticed that the scavenger bag icon (the icon what shows up when you pick up the bag)

was also colored red instead of blue when using the code above.

 

I fixed that. Just use the code in my post above, it's edited.

  • 1 month later...
Опубликовано:

hej ich hab aein prob unzwar hab ich garkein crosshair BITTE HILFE !!!!!!!!!!!!!!

Опубликовано:

hej ich hab aein prob unzwar hab ich garkein crosshair BITTE HILFE !!!!!!!!!!!!!!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Гость
Ответить в тему...

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу

Важная информация

Используя этот сайт, вы соглашаетесь Условия использования.

Account

Navigation

Поиск

Поиск

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.