i got problem when i try to add the "new car code" from aum10(codesnippet). the model of the character not changing to the car model. Here's the screenshots:
Before enter the vehicle:
After enter the vehicle
pretty weird.. please help
Re: [HELP] New Car code from aum10
[Re: Jourdan]
#144280 07/29/0717:0507/29/0717:05
Scratch that. I think the problem is that you're removing the car, which terminates the function before it can morph the player. Try the function below in place of your existing one:
entity* temp_car;
function player_to_car() { temp_car = me; me = null; // now the function is global, and continues to run wait(1); ent_remove(temp_car); player.shadow = off; player._MOVEMODE = _MODE_DRIVING; player._FORCE = 1.5; player._BANKING = 0.1; player.__SLOPES = on; player.__WHEELS = on; // rotate only when moving player.__JUMP = off; // the car can't jump player.__STRAFE = off; // can't strafe player.__TRIGGER = on; astrength.pan = 1.5; // decrease rotation speed (pan) ent_morph (player, car_mdl); car_entity.visible = on; while (key_space == 0) {wait (1);} // press space to switch from car to player temp.x = player.x - 100 * sin(player.pan); // check to see if there is an empty space (near the car door) to deploy the player temp.y = player.y + 100 * cos(player.pan) ; temp.z = player.z; ent_create (car_mdl, player.pos, create_car); vec_set (player.pos, temp); car_entity.visible = off; car_to_player(); }