Hi guys first lets start with some code

Code:
GLfloat position_x = -camera_x;
	GLfloat position_z = -camera_z;
	GLfloat world_rotate = 360.0f - y_rotate;
			
	glRotatef(x_z_rotate, 1.0f, 0.0f, 0.0f);
	glRotatef(world_rotate, 0.0f, 1.0f, 0.0f);
	// if I use y_rotate instead of world_rotate A and D works
        //  W and S will work in a wierd way
	

	glTranslatef(position_x, -height, position_z);
        

       // draw all my stuff here

Code:
if (keys['W'])
					{
						camera_x -= (float)sin(direction * piover180) * 0.05f;
						camera_z -= (float)cos(direction * piover180) * 0.05f;
					}
					if (keys['S'])
					{
						camera_x += (float)sin(direction * piover180) * 0.05f;
						camera_z += (float)cos(direction * piover180) * 0.05f;
					}
					if (keys['A'])
					{
						camera_x += (float)cos(direction * piover180) * 0.05f;
						camera_z += (float)sin(direction * piover180) * 0.05f;
					}
					if (keys['D'])
					{
						camera_x -= (float)cos(direction * piover180) * 0.05f;
						camera_z -= (float)sin(direction * piover180) * 0.05f;
					}
Thats the code I am using to govern the WSAD and I got the W and S to work but A and D works in a wierd way

if I use y_rotate instead of world_rotate in code 1 A and D works but W and S works in a wierd way.

is there any way to fix this?

I've tried alot of stuff and coudlnt' get it working.