IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Please post mod releases in the Mod Showroom

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


  Reply to this topicStart new topicStart Poll

 How do i detect car crashes

 
EDVINOSKE  
Posted: Wednesday, Jul 18 2012, 17:32
Quote Post


Edviuxx
Group Icon
Group: Members
Joined: May 24, 2009

lh.gif

XXXXX



Hi, i need code to detect whenever player crashes car smile.gif anyone help?
Users WebsitePM
  Top
 

 
DK22Pac  
Posted: Wednesday, Jul 18 2012, 18:12
Quote Post


Assembly!
Group Icon
Group: Members
Joined: Apr 12, 2009

un.gif

XXXXX



CODE
if
   player.Defined(0)
then
   if
       actor.Driving($3)
   then
       0811: 0@ = actor $3 car
       0A97: 0@ = car 0@ struct
       0@ += 0xF8
       0A8D: 0@ = read_memory 0@ size 2 virtual_protect 0
       if
           0@ > 0
       then
           // ...
       end
   end
end
Users WebsitePM
  Top
 

 
EDVINOSKE  
Posted: Wednesday, Jul 18 2012, 18:34
Quote Post


Edviuxx
Group Icon
Group: Members
Joined: May 24, 2009

lh.gif

XXXXX



Thank you but i did something wrong it should detect crash only if player is going 100+ and when it crashes it makes player drunk for 5 seconds
CODE
{$CLEO .cs}

//-------------MAIN---------------
thread 'CCC'

:CCC_1
Player.SetDrunkVisuals($PLAYER_CHAR, 0)
wait 0
if
  Player.Defined($PLAYER_CHAR)
jf @CCC_1
  Actor.Driving($PLAYER_ACTOR)
jf @CCC_1

:CCC_2
03C0: 1@ = actor $PLAYER_ACTOR car
02E3: 0@ = car 1@ speed
if
0@ > 100.0
jf @CCC_1
jump @CCC_5

:CCC_4
0332: set_actor $PLAYER_ACTOR bleeding 1
Player.SetDrunkVisuals($PLAYER_CHAR, 100)
wait 15000
jump @CCC_1

:CCC_5
if
  player.Defined(0)
then
  if
      actor.Driving($3)
  then
      0811: 0@ = actor $3 car
      0A97: 0@ = car 0@ struct
      0@ += 0xF8
      0A8D: 0@ = read_memory 0@ size 2 virtual_protect 0
      if
          0@ > 0
      then
          // ...
      end
  end
end
jump @CCC_4


This post has been edited by EDVINOSKE on Wednesday, Jul 18 2012, 18:45
Users WebsitePM
  Top
 

 
DK22Pac  
Posted: Wednesday, Jul 18 2012, 18:52
Quote Post


Assembly!
Group Icon
Group: Members
Joined: Apr 12, 2009

un.gif

XXXXX



CODE
{$CLEO .cs}
0000:
while true
   wait 0
   if
       player.Defined(0)
   then
       if
           actor.Driving($3)
       then
           0811: 0@ = actor $3 car
           02E3: 1@ = car 0@ speed
           if
               1@ > 40.0
           then
               0A97: 0@ = car 0@ struct
               0@ += 0xF8
               0A8D: 0@ = read_memory 0@ size 2 virtual_protect 0
               if
                   0@ > 0
               then
                   player.SetDrunkVisuals(0, 100)
                   0332: set_actor $3 bleeding 1
                   wait 5000
                   while not player.Defined(0)
                       wait 0
                   end
                   player.SetDrunkVisuals(0, 0)
                   0332: set_actor $3 bleeding 0
               end
           end
       end
   end
end
Users WebsitePM
  Top
 

 

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG