I made a cuple of small changes but I am not sure if it works...:
Code:
//defines
define Health, skill1;
define WSpeed, skill2;
define RSpeed, skill3;
define JumpHeight, skill4;
define AttackSpeed, skill5;
//Vars
var move_vec[3] = 0,0,0;
var idle_percent = 0;
var walk_percent = 0;
//Debug Tekst
bmap bmpGrond1 = "sand.pcx"; //Grass Grond
string str_type2 = "Grass"; // Zand Grond
//Water Grond
//Modder Grond
//Lettertype
font fnt_century12 = <Centur12.pcx>,16,20; // Century12 font
//Grond Panels
panel pnl_Grond1
{
bmap = bmpGrond1;
layer = 21;
pos_x = 0;
pos_y = 0;
//on_click = get_off_grond1;
flags = overlay,transparent,refresh;
}
text txt_Grond2
{
pos_x = 0;
pos_y = 65;
layer = 15;
font fnt_century12;
string str_type2;
}
///Einde Debug Scripts
function check_keys()
{
move_vec[0] = (key_w - key_s)*15 *time;
move_vec[1] = (key_a - key_d)*10 *time;
If (move_vec[0] == 0 && move_vec[1] == 0)
{
idle_percent = (idle_percent +5*time)%100;
ent_animate(me,"idle",idle_percent,ANM_CYCLE);
}
else
{
walk_percent = (walk_percent + sign(move_vec[0])*5*time)%100;
ent_animate(player,"walk",walk_percent,ANM_CYCLE);
}
move_mode = IGNORE_YOU + IGNORE_PASSABLE + IGNORE_PUSH + ACTIVATE_TRIGGER + GLIDE;
ent_move(move_vec,NULLVECTOR);
}
function Check_Ground()
{
c_trace(my.x, vector(my.x, my.y, my.z -10000),IGNORE_ME | IGNORE_SPRITES | IGNORE_PASSENTS | IGNORE_PASSABLE | IGNORE_MODELS | SCAN_TEXTURE);
if(str_stri(tex_name, "grass"))
{
pnl_Grond1.visible = on;
}else
{
pnl_Grond1.visible = off;
if(str_stri(tex_name, "sand"))
{
txt_Grond2.visible = on;
}else
{
txt_Grond2.visible = off;
}
}
}
//skill1: Health 100
//skill2: WalkingSpeed 2
//skill3: TurningSpeed 10
//skill4: JumpHeight 10
//skill5: AttackSpeed 10
action Speler_Beweging()
{
player = my;
camera.genius = my;
c_setminmax(me);
while(my.skill1)
{
check_keys();
check_ground();
wait(1);
}
}