if then can`t set function parameter ,i write code like this :
--------------------------------------------------------------------------------
function buttonpro(var i){
var x = mouse_pos.x;
var y = mouse_pos.y;
if(x>=0&&x<=40){
if(y>=0&&y<=20){//btn1
gv = 20;
}
if(y>=40&&y<=60){//btn2
gv = 60;
}
}
}
pan_setbutton(gp[0],0,1,0,0,gb[1],gb[2],gb[3],NULL,buttonpro,NULL,NULL); //btn1
pan_setbutton(gp[0],0,1,0,40,gb[1],gb[2],gb[3],NULL,buttonpro,NULL,NULL);//btn2
--------------------------------------------------------------------------------