And btw, the other problem about pointers is that I don't know whether to write the action first or the main function first. If I write the main function first, I don't have error with the pointer but there is an error in action "no action found"
function main(){
ENTITY* plane = ent_create("plane.mdl",vector(*,*,*), fly);// no "fly" action found, because it goes after this code
}
action char1(){ // another action for another entity
my.x = plane.x; // no error here
}
action fly(){ //also tried function instead of action, the same result
plane = me; // no error here
}
Then I wrote the action before main function:
action char1(){ // this action must be before fly action, because som eof its parameters are used in fly action
my.x = plane.x; // error here, "plane" unknown variable
}
action fly(){
plane = me;
}
function main(){
ENTTIY* plane = ent_create("plane.mdl", vector(*,*,*), fly);//no error here
}
Help please, I don't know what to do in this situation and where to place the pointer.....
Sorry for double post