Quantcast

Jump to content

» «
Photo

Car Exitter Problem

4 replies to this topic
kiffz
  • kiffz

    Player Hater

  • Members
  • Joined: 14 Apr 2012

#1

Posted 14 April 2012 - 05:11 PM Edited by kiffz, 14 April 2012 - 05:27 PM.

Hi @ all, i was scripting a mod, which lets you exit the Car, you are driving and spawning 2 Meters above it, but it is crashing the gama, so can you help me, to fix this?
would be really nice

CODE

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007

{$VERSION 3.1.0027}
{$CLEO .cs}

//-------------MAIN---------------
wait 0
:EXITCAR_0
if
Actor.Defined($PLAYER_ACTOR)
else_jump @EXITCAR_10
jump @EXITCAR_1

:EXITCAR_1
if and
0ADC:   test_cheat "ECAR"
Actor.Driving($PLAYER_ACTOR)
not Actor.Dead($PLAYER_ACTOR)
else_jump @EXITCAR_10
00BC: show_text_highpriority GXT 'CHEAT1' time 1000 flag 1
018C: play_sound 1058 at 0.0 0.0 0.0
jump @EXITCAR_2

:EXITCAR_2
03C0: 1@ = actor $PLAYER_ACTOR car
jump @EXITCAR_3

:EXITCAR_3
if
   Car.Defined(1@)
else_jump @EXITCAR_2
jump @EXITCAR_4


:EXITCAR_4
Car.StorePos(1@, 2@, 3@, 4@)
4@ += 2.0
Car.Health(1@) = 1000
0362: remove_actor $PLAYER_ACTOR from_car_and_place_at 2@ 3@ 4@
Camera.SetBehindPlayer()
jump @EXITCAR_10




:EXITCAR_10
jump @EXITCAR_0

spaceeinstein
  • spaceeinstein

    巧克力

  • Members
  • Joined: 17 Jul 2003

#2

Posted 14 April 2012 - 05:37 PM

CODE
jump @EXITCAR_1

:EXITCAR_1

Where did you learn to do this?

CODE
wait 0
:EXITCAR_0

Code reads top to bottom, not bottom to top.

Bad.boy!
  • Bad.boy!

    SA modder

  • Members
  • Joined: 20 Jun 2010

#3

Posted 14 April 2012 - 05:39 PM Edited by Bad.boy!, 14 April 2012 - 05:41 PM.

You didn't name your thread. And didn't put waits. And your check if car is defined is not necessery because the car is always defined when you're driving it.
If that doesn't work try this:

CODE
{$CLEO .cs}

0000: NOP //Name the thread (or use NOP as I did)

:EXIT_CAR
while Player.Defined($PLAYER_CHAR)
   if and
       Actor.Driving($PLAYER_ACTOR)
       0ADC:   test_cheat "ECAR"
   then
       00BC: show_text_highpriority GXT 'CHEAT1' time 1000 flag 1
       03C0: 1@ = actor $PLAYER_ACTOR car
       Car.StorePos(1@, 2@, 3@, 4@)
       4@ += 2.0
       Car.Health(1@) = 1000
       0362: remove_actor $PLAYER_ACTOR from_car_and_place_at 2@ 3@ 4@  
       018C: play_sound 1058 at 2@ 3@ 4@ //Place at the right location
   end
end
jump @EXIT_CAR


EDIT: Wow three post in a row

LINK/2012
  • LINK/2012

    LIVIN' IN CODE

  • Feroci Racing
  • Joined: 30 Jan 2011
  • Brazil

#4

Posted 14 April 2012 - 05:40 PM Edited by Link2012, 14 April 2012 - 05:42 PM.

No wait, that's the problem. (...)

Put a wait at EXITCAR_0 and EXITCAR_2

@Bad.boyl
The wait 0 in the top of his script will have the same effect as your 0000: NOP
Using NOP instead of wait 0 saves 2 bytes tounge.gif

ChopTheDog.
  • ChopTheDog.

    War. War never changes.

  • Members
  • Joined: 31 May 2010
  • None

#5

Posted 14 April 2012 - 05:42 PM

Does it work now?

Solution answered by different members.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users