_cl_playerskin 0\r
crosshair 1\r
seta crosshair_pickup 1 "crosshair grows then shrinks back when picking up an item"\r
+seta crosshair_color_by_health 0 "if enabled, crosshair color will depend on current health"\r
seta crosshair_pickup_speed 4 "speed of the crosshair pickup effect"\r
seta crosshair_ring_alpha 0.5 "alpha of the crosshair ammo ring"\r
seta crosshair_ring_size 3 "size of the crosshair ammo ring"\r
wcross_color_y = cvar("crosshair_swallowindicator_color_green");\r
wcross_color_z = cvar("crosshair_swallowindicator_color_blue");\r
}\r
+ else if(cvar("crosshair_color_by_health"))\r
+ {\r
+ local float x = getstati(STAT_HEALTH);\r
+ \r
+ //x = red\r
+ //y = green\r
+ //z = blue\r
+ \r
+ wcross_color_z = 0;\r
+ \r
+ if(x > 200)\r
+ {\r
+ wcross_color_x = 0;\r
+ wcross_color_y = 1;\r
+ }\r
+ else if(x > 150)\r
+ {\r
+ wcross_color_x = 0.4 - (x-150)*0.02 * 0.4;\r
+ wcross_color_y = 0.9 + (x-150)*0.02 * 0.1;\r
+ }\r
+ else if(x > 100)\r
+ {\r
+ wcross_color_x = 1 - (x-100)*0.02 * 0.6;\r
+ wcross_color_y = 1 - (x-100)*0.02 * 0.1;\r
+ wcross_color_z = 1 - (x-100)*0.02;\r
+ }\r
+ else if(x > 50)\r
+ {\r
+ wcross_color_x = 1;\r
+ wcross_color_y = 1;\r
+ wcross_color_z = 0.2 + (x-50)*0.02 * 0.8; \r
+ }\r
+ else if(x > 20)\r
+ {\r
+ wcross_color_x = 1;\r
+ wcross_color_y = (x-20)*90/27/100;\r
+ wcross_color_z = (x-20)*90/27/100 * 0.2;\r
+ }\r
+ else\r
+ {\r
+ wcross_color_x = 1;\r
+ wcross_color_y = 0;\r
+ }\r
+ }\r
else\r
{\r
wcross_color_x = cvar("crosshair_color_red");\r