Just a clipboard for helping

Posted By: TWO

Just a clipboard for helping - 04/10/07 22:21

Post deleted by _^Bloodline^_

*HHAHAHA*
Posted By: Tiinusen

Re: TEMP::Thread - 04/10/07 22:26

this is how i solved it

Code:
  
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////



ENTITY* fool;

var speed = 1;

action none(){
ENTITY* hos = fool;
wait(1);
my->flags |= PASSABLE;
me.scale_x = 0.04;
me.scale_y = 0.04;
me.scale_z = 0.04;
c_updatehull(my, 1);
var tmp;
var temp;
while(true){


// GUN STATS
vec_for_vertex(tmp,hos,1453);
vec_set(me.x,tmp);
vec_for_vertex(temp,hos,my.skill1);
vec_set(tmp,temp);
vec_sub(tmp,me.x);
vec_to_angle(me.pan,tmp); // now MY looks at YOU
wait(1);
}
}

function enemy(){
my.scale_x = 0.4;
my.scale_y = 0.4;
my.scale_z = 0.4;
my.skill3 = 200;
my.skill4 = 2;
c_updatehull(my, 1);
while(true){
if()
wait(1);
}

}

function hit(){
if(event_type == EVENT_ENTITY){
error("test");
}

wait(1);

ent_remove(my);

}

action bullet(){

my.scale_x = 0.02;
my.scale_y = 0.02;
my.scale_z = 0.02;
c_updatehull(my, 1);

my.emask |= (ENABLE_SURFACE|ENABLE_IMPACT|ENABLE_ENTITY);
my.event = hit;

while(true){
c_move(my,vector(2*speed,0,0),nullvector,GLIDE);
wait(1);
}


}


action jag(){
var temp;
var cam;
var tmp;
my.scale_x = 0.3;
my.scale_y = 0.3;
my.scale_z = 0.3;

var zhead = 30;
var zbody = 30;
var kk;
var walking = 2300;
var attack;
var runner = 300;
var att = 0;
fool = my;
ENTITY* gun = ent_create("mac10.mdl",vector(0,0,0),none);
ENTITY* bl;



while(true){


vec_set(kk,me.x);
c_move(me, vector(0, (0-90), 0), nullvector, GLIDE);
camera.x = me.x;
camera.y = me.y;
camera.z = me.z + zbody + 100;
vec_set(me.x,kk);
vec_set(temp,me.x);
vec_sub(temp,camera.x);
vec_add(temp,vector(0,0,zhead));
vec_to_angle(camera.pan,temp); // now MY looks at YOU

if(key_y == true){
zhead+= 0.2;
}
if(key_h == true){
zhead-= 0.2;
}
if(key_j == true){
zbody+= 0.2;
}
if(key_g == true){
zbody-= 0.2;
}

if(key_a == true){
me.pan += time_step*3.2*speed ;
}
if(key_d == true){
me.pan -= time_step*3.2*speed ;
}

if(key_w == true){

if(key_shift == true){
c_move(me, vector(0, 15 * time_step *speed, 0), nullvector, GLIDE);
ent_animate(me,"walk2",walking,ANM_CYCLE);
walking += time_step * 12 *speed;
}else{
c_move(me, vector(0, 3 * time_step *speed, 0), nullvector, GLIDE);
ent_animate(me,"walk2",walking,ANM_CYCLE);
walking += time_step * 1.5 *speed;
gun.skill1 = 529;

}

}
if(key_s == true){
c_move(me, vector(0, (0-3) * time_step *speed, 0), nullvector, GLIDE);
ent_animate(me,"walk2",walking,ANM_CYCLE);
walking -= time_step * 1.5 *speed;
gun.skill1 = 529;
}


if(key_space == true && att >= 0){
attack = 0;
att = 0-180;
gun.skill1 = 529;




}
if(att < 0){
gun.skill1 = 529;
ent_animate(me,"shoot",attack,ANM_CYCLE);
attack += time_step * 16 *speed;

if(att == 0-180 || att == 0-90){
var last;
vec_for_vertex(last,gun,72);
bl = ent_create("bullet.mdl",vector(0,0,0),bullet);
vec_set(bl.x,last);
bl.pan = gun.pan - 180;
bl = NULL;
}

att += 2 *speed;
gun.skill1 = 529;

}



wait(1);
}

}



function main(){
level_load("sooc.wmb");
video_mode = 7;
wait(4);

ent_create("milita.mdl",vector(0,50,-60),jag);
ent_create("testgubbe.mdl",vector(0,250,-60),enemy);




}


© 2024 lite-C Forums