Quantcast

Jump to content

» «
Photo

how to use opcode get random car retangle corner?

5 replies to this topic
Anthony ok
  • Anthony ok

    Player Hater

  • Members
  • Joined: 25 Jun 2012

#1

Posted 22 April 2013 - 12:44 PM

I want to use opcode
053E: 38@ = get_random_car_with_model -1 in_rectangle_cornerA 120@ 121@ cornerB 122@ 123@
0327: $TEMPVAR_ACTOR_CAR = get_random_car_with_model -1 in_rectangle_cornerA $111 $112 cornerB $114 $115
i have try it but the car is not get defined sad.gif , the car is located in the top of player. So How to configuring the retangle corner A and B?
code:
CODE

{$CLEO .cs}
thread 'enter ufo'

:1
wait 0
if
0AB0:  key_pressed 85
jf @1
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 4.0 4.0 20.0
04C4: store_coords_to 4@ 5@ 6@ from_actor $PLAYER_ACTOR with_offset -4.0 -4.0 -20.0
053E: 3@ = get_random_car_with_model #SPARROW in_rectangle_cornerA 1@ 2@ cornerB 4@ 5@
if
056E:   car 3@ defined
jf @1
04C4: store_coords_to 6@ 7@ 8@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 -1.0
06C1: create_searchlight 5@ on_car 3@ with_offset 0.0 0.0 -0.5 radius 5.0 target 6@ 7@ 8@ radius 5.0
01B4: set_player $PLAYER_CHAR can_move 0
wait 1500
083C: set_actor $PLAYER_ACTOR velocity_in_direction_XYZ 0.0 0.0 1.0
wait 500
072A: put_actor $PLAYER_ACTOR into_car 3@ driverseat
06B2: destroy_searchlight 5@
06C1: create_searchlight 5@ on_car 3@ with_offset 0.0 0.0 -0.5 radius 4.0 target 6@ 7@ 8@ radius 4.0
06B2: destroy_searchlight 5@
06C1: create_searchlight 5@ on_car 3@ with_offset 0.0 0.0 -0.5 radius 3.0 target 6@ 7@ 8@ radius 3.0
06B2: destroy_searchlight 5@
06C1: create_searchlight 5@ on_car 3@ with_offset 0.0 0.0 -0.5 radius 2.0 target 6@ 7@ 8@ radius 2.0
06B2: destroy_searchlight 5@
06C1: create_searchlight 5@ on_car 3@ with_offset 0.0 0.0 -0.5 radius 1.0 target 6@ 7@ 8@ radius 1.0
06B2: destroy_searchlight 5@
wait 1000
01B4: set_player $PLAYER_CHAR can_move 1
jump @1

check please ....

ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#2

Posted 23 April 2013 - 04:53 PM

The opcodes 053E and 09C0 only find cars which appears random in traffic or spawned by parked_car_generators,
but not these which has been created by script as long they didn't got 01C3: remove_references_to_car
and also not the car which is driven by Player_actor
CODE
{$CLEO .cs}
:Get_Random_Car_Test
thread 'RANDCAR'
//The opcodes 053E and 09C0 only find cars which appears random in traffic or spawned by parked_car_generators,
//but not these which has been created by script as long they didn't got 01C3: remove_references_to_car
//and also not the car which is driven by Player_actor

:RANDCAR_1
wait 0
if
0256:   player $PLAYER_CHAR defined
jf @RANDCAR_1
if
0AB0:   key_pressed 8// ---- key  Backspace
jf @RANDCAR_1
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset  10.0  -1.0  0.0
04C4: create_coordinate 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset -10.0  15.0  0.0
053E: 0@ = get_random_car_with_model -1 in_area 1@ 2@ 11@ 12@
//053E: 0@ = get_random_car_with_model #TAXI in_rectangle_cornerA 1@ 2@ cornerB 11@ 12@
//09C0: 0@ = get_random_car_in_area 1@ 2@ 11@ 12@ 20.0 with_actors -1
wait  50
if
8039:   NOT   0@ ==  -1
jf @RANDCAR_1
00AD: set_car 0@ max_speed_to  0.0
0186: 5@ = create_marker_above_car 0@
0325: 6@ = create_car 0@ fire
wait 3000
0164: disable_marker 5@
02D1: remove_fire 6@
01C3: remove_references_to_car 0@
wait 1000
jump @RANDCAR_1


Cleo4 Opcode 0AE2 can find every car
CODE
{$CLEO .cs}
:Get_Random_Car_Test
thread 'RANDCAR'
//Cleo4 Opcode 0AE2 can find every car

:RANDCAR_1
wait 0
if
0256:   player $PLAYER_CHAR defined
jf @RANDCAR_1
if
0AB0:   key_pressed 8// ---- key  Backspace
jf @RANDCAR_1
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset  0.0  3.0  0.0
if
0AE2: 0@ = random_vehicle_near_point 1@ 2@ 3@ in_radius 10.0 find_next 0 pass_wrecked 0 //IF and SET
jf @RANDCAR_1
if
8039:   NOT   0@ ==  -1
jf @RANDCAR_1
00AD: set_car 0@ max_speed_to  0.0
0186: 5@ = create_marker_above_car 0@
0325: 6@ = create_car 0@ fire
wait 3000
0164: disable_marker 5@
02D1: remove_fire 6@
01C3: remove_references_to_car 0@
wait 1000
jump @RANDCAR_1

Anthony ok
  • Anthony ok

    Player Hater

  • Members
  • Joined: 25 Jun 2012

#3

Posted 24 April 2013 - 03:29 AM

QUOTE (ZAZ @ Tuesday, Apr 23 2013, 16:53)
The opcodes 053E and 09C0 only find cars which appears random in traffic or spawned by parked_car_generators,
but not these which has been created by script as long they didn't got 01C3: remove_references_to_car
and also not the car which is driven by Player_actor

Can we use this opcode to get car above the player?
073E: get_car_in_sphere -1577.942 52.6333 16.3281 radius 4.0 model #INFO handle_as $TEMPVAR_ACTOR_CAR

ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#4

Posted 24 April 2013 - 02:12 PM

073E works like 053E and 09C0, it just requires xyz instead 2 xy corners of a cube
all the 3 opcodes can find a car below or above of player if you set the coords in a propper way
the point is that it won't find every car as i explained and furthermore, cop vehicles often(not always) seems to be ignored
and especially the polmav, i'm shure, it never will be found with these codes

Anthony ok
  • Anthony ok

    Player Hater

  • Members
  • Joined: 25 Jun 2012

#5

Posted 24 April 2013 - 11:57 PM

Can we define vehicle Sparrow as Taxi, what opcode to do that?
i think only this way to find random Sparrow.. ..

ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#6

Posted 25 April 2013 - 03:55 PM

QUOTE (Anthony ok @ Thursday, Apr 25 2013, 00:57)
Can we define vehicle Sparrow as Taxi, what opcode to do that?
i think only this way to find random Sparrow.. ..

you could also catch fishes by using a lamppost
when does the sparrow appear in traffic?




The online users list is currently unavailable due to maintenance but will return in 6 minutes.