Wow! Thank you very much for your time and help guys! laugh

Kartoffel@ thank you man! but unfortunately couldn't get it working, still when resolution changes weapon is not placed at the same spot.

txesmi@ thank you man, it works like a charm! yet the math part is a little bit above of my head, I'm not good at trigonometric.


Here is current code (with weapon bobbing effect) for those who might need it:
Code:
my = ent_create("v_supershotgun+12.tga", nullvector, NULL);
set(my, PASSABLE | NOFILTER | ZNEAR);
vec_fill(&my->scale_x, 0.0625); // cause original size was 256x256, I scale it down to 16x16
my->ambient = 100;

var weapon_bob_move = 0, weapon_bob = 0, weapon_bob_y = 0, weapon_bob_z = 0;

while(my){
	
	camera->arc = 90;		
	camera->pan = cycle(camera->pan - mickey.x / 6.5 * 1, 0, 360);
	camera->tilt = clamp(camera->tilt - mickey.y / 6.5 * 1, -90, 90);		
	camera->roll = 0;
	
	if(key_w){ weapon_bob_move = (weapon_bob_move + 30 * time_step) % 360; }
	weapon_bob = clamp(weapon_bob + 4 * time_step * 0.1 - weapon_bob / 3 * time_step, 0, 2);
	weapon_bob_y = sin(weapon_bob_move) * weapon_bob * 0.5;						
	weapon_bob_z = cos(weapon_bob_move * 2) * weapon_bob * 0.25;
	
	var x_distance = 16, z_distance = 17;		
	my->skill20 = fcos(0.5 * camera->arc, x_distance);
	my->skill21 = -weapon_bob_y;
	my->skill22 = 8 - fsin(0.5 * camera->arc, z_distance) * screen_size.y / screen_size.x + weapon_bob_z;
	
	vec_set(&my->x, &my->skill20);
	vec_rotate(&my->x, &camera->pan);
	vec_add(&my->x, &camera->x);
	
	ANGLE temp_angle;
	vec_set(&temp_angle, vector(180, 0, 0));
	ang_add(&temp_angle, &camera->pan);
	vec_set(&my->pan, &temp_angle);
	
	wait(1);
}




Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung