Give this a try (paste into a new *.c file and start it in SED):
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////

// joyNum 1/2, buttonNum 1-32
int joy_pressed(int joyNum, int buttonNum)
{
	var bitmask = joy_buttons;
	if(joyNum == 2) bitmask = joy2_buttons;

	if(buttonNum <= 10) return !!((bitmask<<10) & (1 << buttonNum-1));
	return !!(bitmask & (1 << buttonNum-11));
}

// joyNum 1/2, axisNum 1-6
var joy_axis(int joyNum, int axisNum)
{
	VECTOR *source[2];
	
	if(axisNum < 1 || axisNum > 6) return 0;
	if(joyNum == 2)
	{
		source[0] = &joy2_raw;
		source[1] = &joy2_rot;
	}
	else
	{
		source[0] = &joy_raw;
		source[1] = &joy_rot;
	}
	axisNum--;
	var *pv = source[axisNum/3];
	return pv[axisNum%3]; // read var at x,y,z
}

// joyNum 1/2
int joy_dpad(int joyNum)
{
	if(joyNum == 2) return joy2_hat;
	return joy_hat;
}

void main()
{
	fps_max = 60;
	video_mode = 9;
	
	while(1)
	{
		draw_text(str_printf(NULL,"num_joysticks: %d",(int)num_joysticks),20,20,COLOR_RED);
		int i,j;
		for(j = 1; j <= 2; j++)
		{
				draw_text(str_printf(NULL,"Joy%d-DPad: %d",j,(int)joy_dpad(j)),200*j,20,COLOR_RED);
			for(i = 1; i <= 6; i++)
			{
				draw_text(str_printf(NULL,"Joy%d-Axis%d: %d",j,i,(int)joy_axis(j,i)),200*j,40+20*i,COLOR_RED);
			}
			for(i = 1; i <= 32; i++)
			{
				draw_text(str_printf(NULL,"Joy%d-Button%d: %d",j,i,(int)joy_pressed(j,i)),200*j,180+20*i,COLOR_RED);
			}
		}
		
		wait(1);
	}
}



Check the values on screen when you move the joystick or push buttons, then use the corresponding axes in your script (copy the helper functions).
For example:

Code:
camera.pan += joy_axis(1, 1)*0.1*time_step;
camera.pan = ang(camera.pan);
my.pan = camera.pan; // assuming a first person camera
camera.tilt -= joy_axis(1, 2)*0.1*time_step; // might need to be "+" as well instead of "-"
camera.tilt = clamp(camera.tilt,-85,85);



"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends