Do you have more info on that error?
BTW. Got it working with this:
////////////////////////////////////////////////////////////////
// Paint program - (c) 2005 by Claus Nielsen
// v1.2 Paints onto player's skin
////////////////////////////////////////////////////////////////
bmap PAPER = <PAPER.bmp>;
bmap YELLOW = <color.bmp>;
bmap BLUE = <color.bmp>;
bmap BLACK = <color.bmp>;
bmap WHITE = <color.bmp>;
bmap RED = <color.bmp>;
bmap GREEN = <color.bmp>;
bmap CYAN = <color.bmp>;
bmap cursor = <arrow.pcx>;
bmap slider_bg = <slider_bg.bmp>;
bmap slider = <slider.bmp>;
bmap* PL_SKIN;
var D3DCOLOR[3];
var BRUSHSIZE = 10;
var BRUSHDETAIL = 5;
var video_mode = 7;
var video_depth = 32;
var video_screen = 2;
font arial_font = "arial",0,18;
/////////////////////////////////////////////////
function map_scaled(coord,oldmax,newmax)
{
return(max(coord,1) / oldmax * newmax);
}
/////////////////////////////////////////////////
function bmap_draw(TBMAP,SBMAP)
{
var i;var k;var t;
var D3DPIXEL;
var D3DFORMAT;
while(i < bmap_height(TBMAP))
{
k = 0;
t += 1;
while(k < bmap_width(TBMAP))
{
// Read a pixel
bmap_lock(SBMAP,0);
temp.x = int(map_scaled(k,bmap_width(TBMAP),bmap_width(SBMAP)));
temp.y = int(map_scaled(i,bmap_height(TBMAP),bmap_height(SBMAP)));
D3DPIXEL = pixel_for_bmap(SBMAP,temp.x,temp.y);
bmap_unlock(SBMAP);
// Draw a pixel
D3DFORMAT = bmap_lock(TBMAP,0);
pixel_to_bmap(TBMAP,k,i,D3DPIXEL);
bmap_unlock(TBMAP);
k += 1;
t += 1;
if(t - (max_loops-1) >= 0) {wait(1);t = 0;}
}
i += 1;
if(t - (max_loops-1) >= 0) {wait(1);t = 0;}
}
}
////////////////////////////////////////////////////////////////
panel paper_pan
{
bmap = PAPER;
pos_x = 0;
pos_y = 20;
flags = visible,refresh;
layer = 1;
}
////////////////////////////////////////////////////////////////
text desc1
{
font = arial_font;
pos_x = 295;
pos_y = 1;
string = "Detail:";
layer = 4;
flags = visible;
red = 1;
green = 1;
blue = 1;
}
text desc2
{
font = arial_font;
pos_x = 410;
pos_y = 1;
string = "Size:";
layer = 4;
flags = visible;
red = 1;
green = 1;
blue = 1;
}
////////////////////////////////////////////////////////////////
function NewColor(but,pan)
{
if(but == 1) {temp.red = 255;temp.green = 255;temp.blue = 0;}
if(but == 2) {temp.red = 0;temp.green = 0; temp.blue = 255;}
if(but == 3) {temp.red = 1;temp.green = 1;temp.blue = 1;}
if(but == 4) {temp.red = 255;temp.green = 255;temp.blue = 255;}
if(but == 5) {temp.red = 255;temp.green = 0;temp.blue = 0;}
if(but == 6) {temp.red = 0;temp.green = 255;temp.blue = 0;}
if(but == 7) {temp.red = 0;temp.green = 255;temp.blue = 255;}
vec_set(D3DCOLOR,temp);
}
////////////////////////////////////////////////////////////////
panel color_buts
{
pos_x = 5;
pos_y = 1;
button = 0,0,YELLOW,YELLOW,YELLOW,NewColor,null,null;
button = 18,0,BLUE,BLUE,BLUE,NewColor,null,null;
button = 36,0,BLACK,BLACK,BLACK,NewColor,null,null;
button = 54,0,WHITE,WHITE,WHITE,NewColor,null,null;
button = 72,0,RED,RED,RED,NewColor,null,null;
button = 90,0,GREEN,GREEN,GREEN,NewColor,null,null;
button = 108,0,CYAN,CYAN,CYAN,NewColor,null,null;
flags = visible;
layer = 2;
}
////////////////////////////////////////////////////////////////
panel detail_slider
{
bmap = slider_bg;
pos_x = 350;
pos_y = 1;
layer = 3;
flags = visible;
hslider = 0,0,50,slider,1,120,BRUSHDETAIL;
}
panel brush_slider
{
bmap = slider_bg;
pos_x = 455;
pos_y = 1;
layer = 3;
flags = visible;
hslider = 0,0,50,slider,1,120,BRUSHSIZE;
}
////////////////////////////////////////////////////////////////
function COLORIMG(_BMAP,&_D3DCOLOR)
{
var D3DFORMAT;
var D3DPIXEL;
var i;var k;
D3DFORMAT = bmap_lock(_BMAP,0);
D3DPIXEL = pixel_for_vec(_D3DCOLOR,100,D3DFORMAT);
while(i < bmap_height(_BMAP))
{
k = 0;
while(k < bmap_width(_BMAP))
{
pixel_to_bmap(_BMAP,k,i,D3DPIXEL);
k += 1;
}
i += 1;
}
bmap_unlock(_BMAP);
}
////////////////////////////////////////////////////////////////
function main()
{
var D3DFORMAT;
var D3DPIXEL;
var i;
var vi;
var 2DPOS[2];
level_load("level.wmb");
wait(3);
player = ent_create("hero.mdl",nullvector,null);
vec_set(bg_color,vector(204,204,204));
vec_set(D3DCOLOR,vector(1,1,1));
temp.red = 255;temp.green = 255;temp.blue = 0;
COLORIMG(YELLOW,temp);
temp.red = 0;temp.green = 0;temp.blue = 255;
COLORIMG(BLUE,temp);
temp.red = 1;temp.green = 1;temp.blue = 1;
COLORIMG(BLACK,temp);
temp.red = 255;temp.green = 0;temp.blue = 0;
COLORIMG(RED,temp);
temp.red = 0;temp.green = 255;temp.blue = 0;
COLORIMG(GREEN,temp);
temp.red = 0;temp.green = 255;temp.blue = 255;
COLORIMG(CYAN,temp);
mouse_map = cursor;
mouse_mode = 2;
while(!key_enter)
{
mouse_pos.x = pointer.x;
mouse_pos.y = pointer.y;
if(mouse_left && (mouse_pos.x > paper_pan.pos_x && mouse_pos.x < paper_pan.pos_x + bmap_width(paper_pan.bmap))
&& (mouse_pos.y > paper_pan.pos_y && mouse_pos.y < paper_pan.pos_y + bmap_height(paper_pan.bmap)))
{
// Prepare for drawing
D3DFORMAT = bmap_lock(PAPER,0);
// Create the pixel to draw with
D3DPIXEL = pixel_for_vec(D3DCOLOR,100,D3DFORMAT);
// Drawing position
2DPOS.x = mouse_pos.x - paper_pan.pos_x;
2DPOS.y = mouse_pos.y - paper_pan.pos_y;
// Draw the pixel onto the bitmap
pixel_to_bmap(PAPER,2DPOS.x,2DPOS.y,D3DPIXEL);
// Use a circled brush
i = 1;
while(i < BRUSHSIZE)
{
vi = 0;
while(vi < 360)
{
if((2DPOS.x + int(fcos(vi,i)) > 0 && 2DPOS.x + int(fcos(vi,i)) < bmap_width(paper_pan.bmap))
&& (2DPOS.y + int(fsin(vi,i)) > 0 && 2DPOS.y + int(fsin(vi,i)) < bmap_height(paper_pan.bmap)))
{
pixel_to_bmap(PAPER,2DPOS.x + int(fcos(vi,i)),2DPOS.y + int(fsin(vi,i)),D3DPIXEL);
}
vi += BRUSHDETAIL;
}
i += 1;
}
// Unlock the bitmap
bmap_unlock(PAPER);
}
wait(0.1);
}
camera.x = player.x + fcos(player.pan,100);
camera.y = player.y + fsin(player.pan,100);
camera.z += 10;
camera.pan = player.pan + 180;
paper_pan.visible = off;
PL_SKIN = bmap_for_entity(player,0);
bmap_draw(PL_SKIN,PAPER);
var cam_pan;
cam_pan = camera.pan;
while(1)
{
camera.x = player.x + fcos(cam_pan,100);
camera.y = player.y + fsin(cam_pan,100);
vec_set(temp,player.x);
vec_sub(temp,camera.x);
vec_to_angle(camera.pan,temp);
if(mouse_left)
{
mouse_mode = 0;
cam_pan -= mouse_force.x * 10;
}
else
{
mouse_mode = 2;
mouse_pos.x = pointer.x;
mouse_pos.y = pointer.y;
}
wait(1);
}
}
////////////////////////////////////////////////////////////////