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 Attention:

This is for the discussion and releasing of tutorials for modifying GTA. Anything that isn't a tutorial will be deleted without notification.

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)


Pages: (31) « First ... 21 22 [23] 24 25 ... Last »  ( Go to first unread post ) Reply to this topicStart new topicStart Poll

 [GTA SA] ~ CLEO Script Tutorial ~

 
kalonkas  
Posted: Sunday, Aug 19 2012, 12:41
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Aug 18, 2012

XXXXX



Thanks ZAZ but now i need to make him give me beer when i press Y OR better spawn an gui [menue] and i can choose drink or smoke.


Silent , i don't need it to move.

This post has been edited by kalonkas on Sunday, Aug 19 2012, 13:01
PM
  Top
 

 
ZAZ  
Posted: Sunday, Aug 19 2012, 13:26
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (kalonkas @ Sunday, Aug 19 2012, 13:41)
Thanks ZAZ but now i need to make him give me beer when i press Y OR better spawn an gui [menue] and i can choose drink or smoke.


Silent , i don't need it to move.

are you impatient? biggrin.gif
you'll need one more loop

but please improve first your current script
start the script with a default loop which checks if $PLAYER_CHAR is defined, opcode 0256:
as well a condition which must be passed to spawn your actor
a keypress check or if player is near the spawn location

Consider that the map isn't solid everywhere
collisions models a working only in the players range of 300 units
actors are falling down to nirwana if the player is far away

opcode 0256: should prevent crashes if the player dies or gets arrested

furthermore does your script need a cleanup part
Release the defined actor from script when the script has done its work with opcode 01C2: or 009B: or 034F:
after that can you let the code jump back to beginning so that the whole script runs in a loop instead end_thread
Users WebsitePM
  Top
 

 
kalonkas  
Posted: Sunday, Aug 19 2012, 13:51
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Aug 18, 2012

XXXXX



Yes, i'm a bit impatient biggrin.gif


Now my script looks better?

CODE
{$CLEO .cs}
:Actor
03A4: name_thread "ACTOR"

:Actor_1

0001: wait  1000 ms
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @Actor_1
if
00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  80.5  80.5  80.5
004D: jump_if_false @Actor_1

0247: request_model #VBFYCRP

repeat
   wait 0
   if
       0248:   model #VBFYCRP available
   then
       break
   end
until false

009A: 0@ = create_actor  4 #VBFYCRP at  -2347.7383 639.5254 42.07
0173: set_actor 0@ Z_angle_to 180.0

0249: release_model #VBFYCRP

0A93: end_custom_thread


This post has been edited by kalonkas on Sunday, Aug 19 2012, 14:25
PM
  Top
 

 
ZAZ  
Posted: Sunday, Aug 19 2012, 15:17
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (kalonkas @ Sunday, Aug 19 2012, 14:51)
Now my script looks better?

yes, a little bit
wait 1000 is to much, wait 0 is enough
also the code to remove reference is missing

maybe you wanna keep the high level lang, have look to the script below
test it, kill the actor and see what happens
CODE
{$CLEO .cs}
:Actor_1
03A4: name_thread 'Actor'

while true
wait 0
   if
       0256:   player $PLAYER_CHAR defined
   then

       if
           00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  80.5  80.5  80.5
       then
           0247: request_model #VBFYCRP

           repeat
           wait 0
               if
                   0248:   model #VBFYCRP available
               then
                   break
               end
           until false

           009A: 0@ = create_actor  4 #VBFYCRP at  -2347.7383 639.5254 42.07
           0173: set_actor 0@ Z_angle_to 180.0
           0249: release_model #VBFYCRP

           while   0256:   player $PLAYER_CHAR defined
           wait 0
               if
                   8118: not  actor 0@ dead
               then
                   // dealer script
               else
                   break
               end
           end

           01C2: remove_references_to_actor 0@
       end
   end
end
Users WebsitePM
  Top
 

 
kalonkas  
Posted: Sunday, Aug 19 2012, 16:28
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Aug 18, 2012

XXXXX



Cool, now it respawns when i kill him.

And another thing, i've put " bar_ufo " with MEd , as the rest of my base, but near that bar always spawns random actors, any way to dont make em spawn there?
PM
  Top
 

 
ZAZ  
Posted: Sunday, Aug 19 2012, 16:53
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (kalonkas @ Sunday, Aug 19 2012, 17:28)
Cool, now it respawns when i kill him.

yes, but that should not happen
you have to add a loop after 01C2: remove_references_to_actor 0@ which checks if player_actor is not near_point -2347.7383 639.5254 42.07

QUOTE
And another thing, i've put " bar_ufo " with MEd , as the rest of my base, but near that bar always spawns random actors, any way to dont make em spawn there?

maybe it's an object which have an extention to spawn actors
Users WebsitePM
  Top
 

 
kalonkas  
Posted: Sunday, Aug 19 2012, 16:58
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Aug 18, 2012

XXXXX



Which loop should i use?

CODE
00FE:   actor $PLAYER_ACTOR  0 [B]not[/B] (in-sphere)near_point -2347.7383 639.5254 42.07 radius  80.5  80.5  80.5


biggrin.gif?


CODE
80EC:   not actor $PLAYER_ACTOR 0 near_point 1812.369 -1929.922 radius 500.0 500.0


I've found this, is it good?

CODE
009A: 0@ = create_actor  4 #VBFYCRP at  -2347.7383 639.5254 42.07
          0173: set_actor 0@ Z_angle_to 180.0
          0249: release_model #VBFYCRP

          while   0256:   player $PLAYER_CHAR defined
          wait 0
                  8118: not  actor 0@ dead
                  if
                  80EC:   not actor $PLAYER_ACTOR 0 near_point -2347.7383 639.5254 42.07 radius 80.5 80.5

                 
              then
                  // dealer script



not working, actor stays in air confused.gif




CODE
while   0256:   player $PLAYER_CHAR defined
          wait 0
          if
                  8118: not  actor 0@ dead
                                             
              then
                  // dealer script
              else
                  break
              end
          end
                     if
                  80EC:   not actor $PLAYER_ACTOR 0 near_point -2347.7383 639.5254 42.07 radius 80.5 80.5
                  then
          01C2: remove_references_to_actor 0@
      end
  end
end


GTA sa crashes when i load savegame.

This post has been edited by kalonkas on Sunday, Aug 19 2012, 17:10
PM
  Top
 

 
ZAZ  
Posted: Sunday, Aug 19 2012, 17:38
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




a loop, not only a check
like this
CODE
           while  00EC:   actor $PLAYER_ACTOR 0 near_point -2347.7383 639.5254 42.07 radius 85.5 85.5
           wait 0
           end


or this
CODE
           repeat
           wait 0
           until 80EC: not  actor $PLAYER_ACTOR 0 near_point -2347.7383 639.5254 42.07 radius 85.5 85.5
Users WebsitePM
  Top
 

 
kalonkas  
Posted: Sunday, Aug 19 2012, 17:48
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Aug 18, 2012

XXXXX



CODE
{$CLEO .cs}
:Actor_1
03A4: name_thread 'Actor'

while true
wait 0
  if
      0256:   player $PLAYER_CHAR defined
  then

      if
          00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  80.5  80.5  80.5
      then
          0247: request_model #VBFYCRP

          repeat
          wait 0
              if
                  0248:   model #VBFYCRP available
              then
                  break
              end
          until false

          009A: 0@ = create_actor  4 #VBFYCRP at  -2347.7383 639.5254 42.07
          0173: set_actor 0@ Z_angle_to 180.0
          0249: release_model #VBFYCRP

          while   0256:   player $PLAYER_CHAR defined
          wait 0
       
              if
                  8118: not  actor 0@ dead
              then
                  // dealer script
              else
                  break
              end
          end

          01C2: remove_references_to_actor 0@
           repeat
          wait 0
          until 80EC: not  actor $PLAYER_ACTOR 0 near_point -2347.7383 639.5254 42.07 radius 85.5 85.5

      end
  end
end


Now actor dies.

Need more cleans or i can script dealer script [ with reply Y or N] biggrin.gif? And how do i start, with which op code or loop?
PM
  Top
 

 
ZAZ  
Posted: Sunday, Aug 19 2012, 18:28
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




looks good, just one thing: there should also be a check if player_actor is near_point -2347.7383 639.5254 42.07 together with the check if actor dead
because in the case, that the player comes to that area and the actor spawns but the player leaves then the location, should the actors reference be removed and the script should run in the default loop
to spare performance

CODE
           while   0256:   player $PLAYER_CHAR defined
           wait 0
               if  and
                   8118: not  actor 0@ dead
                   00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  85.5  85.5  85.5
               then
                   // dealer script
               else
                   break
               end            
           end

if there are more than one conditions in a check, it needs to determine if it means OR or AND


QUOTE (kalonkas @ Sunday, Aug 19 2012, 18:48)
And how do i start, with which op code or loop?

you can use this script and expand it
at that position where i wrote "// dealer script" will we add the action
it needs to build sequences:
check if player stand close to the actor to show a message
check if key pressed to give the bottle

it needs also to spawn a bottle first
do you know the modelname or id number of a bottle?

should there be used specified deal animations?
it needs also to load animations first
read about Animations

should there be a special camera view during the deal?
Users WebsitePM
  Top
 

 
kalonkas  
Posted: Sunday, Aug 19 2012, 18:52
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Aug 18, 2012

XXXXX



Thanks blush.gif

So bottle id is : ? I don't know, going to search now.
Animation should be of CJ drinking like gang members and if drink too much he gets drunk (camera start moving) http://www.gtagarage.com/mods/show.php?id=201 like in this mod. I havent tried this mod, just saw it. I want animation like on gta samp on roleplay servers , when get drunk camera start shaking, moving and even when u go in a car its alot harder to drive.

This post has been edited by kalonkas on Sunday, Aug 19 2012, 19:07
PM
  Top
 

 
ZAZ  
Posted: Sunday, Aug 19 2012, 19:30
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (kalonkas @ Sunday, Aug 19 2012, 19:52)
Thanks  blush.gif

So bottle id is : ? I don't know, going to search now.
Animation should be of CJ drinking like gang members and if drink too much he gets drunk (camera start moving)  http://www.gtagarage.com/mods/show.php?id=201 like in this mod. I havent tried this mod, just saw it. I want animation like on gta samp on roleplay servers , when get drunk camera start shaking, moving and even when u go in a car its alot harder to drive.

as bottle can we use model id 1520
you have to load the animation file "GANGS" for drinking
and if the dealer should do deal animations like pay, give'n take
you have also to load the animation file "DEALER"...
...together with model loading of the actor

if you did it right you can add an animation code for testing at that position where i wrote "// dealer script":
CODE
0605: actor 0@ perform_animation_sequence "DRNKBR_PRTL" from_file "GANGS"  4.0  1  1  1  0  -1


so do that and post your progress
Users WebsitePM
  Top
 

 
kalonkas  
Posted: Monday, Aug 20 2012, 10:02
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Aug 18, 2012

XXXXX



CODE
08E8: assign_external_script_handle 'DEALER' to_model 0@
What does this do ? i need an op to make that actor talk i came near him [so i can press Y or N]



Something like this ?

CODE
if
00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  4.5  4.5  4.5
then
wait 0
If
0AB0:   key_pressed 89
then
00FE:   actor $PLAYER_ACTOR perform_animation_sequence "DRNKBR_PRTL" from_file "GANGS"  4.0  1  1  1  0  -1
end


CODE
while true
wait 0
 if
     0256:   player $PLAYER_CHAR defined
 then

     if
         00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  80.5  80.5  80.5
     then
         0247: request_model #VBFYCRP
         0247: request_model #1520
         04ED: load_animation "GANGS"



         repeat
         wait 0
             if
                 0248:   model #VBFYCRP available
                 0248:   model #1520 available
             then
                 break
             end
or this. ? confused.gif


Made this too
CODE
04ED: load_animation "Gangs"
wait 0
if
04EE:   animation "Gangs" loaded
else_jump @Actor_1


This post has been edited by kalonkas on Monday, Aug 20 2012, 16:48
PM
  Top
 

 
ZAZ  
Posted: Monday, Aug 20 2012, 16:54
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (kalonkas @ Monday, Aug 20 2012, 11:02)
CODE
08E8: assign_external_script_handle 'DEALER' to_model 0@
What does this do ? i need an op to make that actor talk i came near him [so i can press Y or N]
works only in main.scm, it assigne an externscript of script.img to an actor



QUOTE
Something like this ?

CODE
if
00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  4.5  4.5  4.5
then
wait 0
If
0AB0:   key_pressed 89
then
00FE:   actor $PLAYER_ACTOR perform_animation_sequence "DRNKBR_PRTL" from_file "GANGS"  4.0  1  1  1  0  -1
end
it should be closer, maybe 1.5 or 2.5
the keypress check must we implement in another way, i'll show it later, as i said, we have to build sequences


QUOTE
CODE
while true
wait 0
 if
     0256:   player $PLAYER_CHAR defined
 then

     if
         00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  80.5  80.5  80.5
     then
         0247: request_model #VBFYCRP
         0247: request_model #1520
         04ED: load_animation "GANGS"



         repeat
         wait 0
             if
                 0248:   model #VBFYCRP available
                 0248:   model #1520 available
             then
                 break
             end
or this. ? confused.gif

ok, but as i said:
QUOTE
if there are more than one conditions in a check, it needs to determine if it means OR or AND
Users WebsitePM
  Top
 

 
kalonkas  
Posted: Monday, Aug 20 2012, 17:00
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Aug 18, 2012

XXXXX



So, how i have to do it?

Anyway , have you got skype biggrin.gif?

CODE
{$CLEO .cs}
:Actor_1
03A4: name_thread 'Actor'

while true
wait 0
 if
     0256:   player $PLAYER_CHAR defined
 then

     if
         00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  80.5  80.5  80.5
     then
         0247: request_model #VBFYCRP
         0247: request_model #1520
        04ED: load_animation "GANGS"

         repeat
         wait 0
             if  and
                 0248:   model #VBFYCRP available
                 0248:   model #1520 available
                 04EE:   animation "GANGS" loaded

             then
                 break
             end
         until false

         009A: 0@ = create_actor  4 #VBFYCRP at  -2347.7383 639.5254 42.07
         0173: set_actor 0@ Z_angle_to 180.0
         0249: release_model #VBFYCRP

         while   0256:   player $PLAYER_CHAR defined
         wait 0
     
             if  and
                 8118: not  actor 0@ dead
                  00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  85.5  85.5  85.5
             then
                 if
00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  2.5  2.5  2.5
then
wait 0
If
0AB0:   key_pressed 89
then
00FE:   actor $PLAYER_ACTOR perform_animation_sequence "DRNKBR_PRTL" from_file "GANGS"  4.0  1  1  1  0  -1

             else
                 break
             end
         end

         01C2: remove_references_to_actor 0@
          repeat
         wait 0
         until 80EC: not  actor $PLAYER_ACTOR 0 near_point -2347.7383 639.5254 42.07 radius 85.5 85.5

     end
 end
end


Like this? But when i try to compile it says - Compiled file has no header, so the model name #1520 can not be used. Use number ID instead.

This post has been edited by kalonkas on Monday, Aug 20 2012, 17:06
PM
  Top
 

 
ZAZ  
Posted: Monday, Aug 20 2012, 20:14
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (kalonkas @ Monday, Aug 20 2012, 18:00)


Like this? But when i try to compile it says - Compiled file has no header, so the model name #1520 can not be used. Use number ID instead.

you didn't read the tutorial careful where i wrote in the lesson "Spawn a 3D model"
QUOTE
# marks the connected entry as filename of a loadable model
For Cleo can only be used models which are defined in vehicles.ide, peds.ide or default.ide
Other models needs to use their ID number

For exemble to spawn the object 1655, waterjumpx2 of data\maps\generic\multiobj.ide
and posted an example script


in addition is your if-then-end construct wrong
QUOTE
if
00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  2.5  2.5  2.5
then
wait 0
If
0AB0:   key_pressed 89
then
00FE:   actor $PLAYER_ACTOR perform_animation_sequence "DRNKBR_PRTL" from_file "GANGS"  4.0  1  1  1  0  -1


Every IF-THEN needs it's END
It's like a open and a close tag
[CODE ]script[/CODE ]

the IF-THEN-END's checks can be written in a row

or checks inside checks like boxes in a box in a box
so it can happens that you find more END's at the end
CODE
        end
    end
end


CODE
               if  and
                   0248:   model #VBFYCRP available
                   04EE: animation "GANGS" loaded
                   04EE: animation "DEALER" loaded
               then
                   break
               end


--------------

only if-then-else-end is possible
CODE
if
...
then
...
else
...
end


but not
if-then-else-else-end

CODE
              if  and
                  8118: not  actor 0@ dead
                  00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  85.5  85.5  85.5
              then
                  // dealer script
              else
                  break
              end



QUOTE
have you got skype

yes but i don't like to chatt for hours
i don't know why i help you so much, normally you should study the tutorial, try the example scripts, modify it a little bit and get praxis in coding and learn to find informations by yourself
Users WebsitePM
  Top
 

 
kalonkas  
Posted: Tuesday, Aug 21 2012, 05:12
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Aug 18, 2012

XXXXX



Thanks for your help , i really appreciate it, but for now i leave that script , last thing - could you help me with your elevator script ?



i use your gates script, it works perfectly, but i want to make an lift with it. I put all coords right but i need that only Z coords move when i press a key, but it doesnt /:


CODE
{$CLEO .cs}
:ONEDOOR_1
03A4: name_thread 'ONEDOOR'

:ONEDOOR_3
0001: wait 0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @ONEDOOR_3
if
00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2288.26 582.877 33.706 radius  80.5  80.5  80.5
004D: jump_if_false @ONEDOOR_3
0107: 5@ = create_object 3095 at -2288.26 582.877 33.706

0007: 7@ =  -2288.26     // default X (closed)
0007: 8@ =  582.877  //default Y (closed)
0007: 9@ =  33.706  //default Z (closed)
0007: 11@ =  -2288.26    // destination X (open)
0007: 12@ =  582.877  // destination Y (open)  
0007: 13@ =  50.906  // destination Z (open)
0006: 14@ = 0
0006: 15@ = 0
0002: jump @ONEDOOR_12

:ONEDOOR_12
0001: wait 0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @ONEDOOR_75
if
80FE:   not actor $PLAYER_ACTOR  0 (in-sphere)near_point 7@ 8@ 9@ radius  95.5  95.5  95.5
004D: jump_if_false @ONEDOOR_13
0002: jump @ONEDOOR_75

:ONEDOOR_13
if
0039:   15@ ==  0  // integer values
004D: jump_if_false @ONEDOOR_15
if
00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point 7@ 8@ 9@ radius  20.5  20.5  20.5
0AB0:   key_pressed 76//------------------key = L
004D: jump_if_false @ONEDOOR_15
0006: 15@ = 1
000A: 14@ +=  1  // integer values
0002: jump @ONEDOOR_15

:ONEDOOR_15
if
0039:   15@ ==  1  // integer values
004D: jump_if_false @ONEDOOR_18

:ONEDOOR_16
if
0039:   14@ ==  1  // integer values
004D: jump_if_false @ONEDOOR_17
034E: move_object 5@ to  11@ 12@ 13@ speed  0.0 0.0 0.9 flag  0
if
04E5:  object 5@ near_point 11@ 12@ 13@ radius 1.0 1.0 flag 0
004D: jump_if_false @ONEDOOR_17
0006: 14@ = 2
0006: 15@ = 1
0001: wait 500 ms
0002: jump @ONEDOOR_29

:ONEDOOR_17
if
0039:   14@ ==  3  // integer values
004D: jump_if_false @ONEDOOR_18
034E: move_object 5@ to  7@ 8@ 9@ speed  0.0 0.0 0.9 flag  0
if
04E5:  object 5@ near_point 7@ 8@ 9@ radius 0.1 0.1 flag 0
004D: jump_if_false @ONEDOOR_18
0006: 15@ = 0
0006: 14@ = 0

:ONEDOOR_18
if  and
0039:   14@ ==  2  // integer values
80FE:   not actor $PLAYER_ACTOR  0 (in-sphere)near_point 7@ 8@ 9@ radius  19.0  19.0  15.0
004D: jump_if_false @ONEDOOR_19
0006: 15@ = 1
0006: 14@ = 3
0002: jump @ONEDOOR_12

:ONEDOOR_19
if  and
0039:   14@ ==  2  // integer values
80FE:   not actor $PLAYER_ACTOR  0 (in-sphere)near_point 7@ 8@ 9@ radius  3.0  3.0  5.0
0AB0:   key_pressed 76
004D: jump_if_false @ONEDOOR_29
0006: 15@ = 1
0006: 14@ = 3
0002: jump @ONEDOOR_12

:ONEDOOR_29
0002: jump @ONEDOOR_12

:ONEDOOR_75
01C4: remove_references_to_object 5@  // This object will now disappear when the player looks away
03F0: text_draw_toggle  0  
0001: wait 1000 ms
0006: 14@ = 0
0006: 15@ = 0
0002: jump @ONEDOOR_3


CODE
{$CLEO .cs}

:LIFTS_1
03A4: name_thread 'LIFT'

:LIFTS_2
0001: wait 0 ms
00D6: if 0
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @LIFTS_2
00D6: if 0
00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -545.9601 2594.1699 53.5156 radius 200.0 200.0 200.0
004D: jump_if_false @LIFTS_2
0247: request_model 16795
0247: request_model 16797
038B: load_requested_models

:LIFTS_3
0001: wait 0 ms
if  and
0248:   model 16795 available
0248:   model 16797 available
004D: jump_if_false @LIFTS_3
0107: 1@ = create_object 16795 at -534.84 2632.83 52.5
0177: set_object 1@ Z_angle_to 268.0  
0392: make_object 1@ moveable 1
0107: 2@ = create_object 16797 at -532.875 2657.53 33.13
0177: set_object 2@ Z_angle_to -2.34
0392: make_object 2@ moveable 1
0006: 3@ = 0

:LIFTS_4
0001: wait 0 ms
00D6: if 0
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @LIFTS_13
01BB: store_object 1@ position_to 11@  12@  13@
00D6: if 0
00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -545.9601 2594.1699 53.5156 radius 210.0 210.0 210.0
004D: jump_if_false @LIFTS_13
if
0039:   3@ == 0
004D: jump_if_false @LIFTS_5
if   or
00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -534.84 2632.83 52.5 radius 3.0 3.0 3.0
00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -534.48 2640.05 46.39 radius 8.0 8.0 3.0
004D: jump_if_false @LIFTS_5      
0006: 3@ = 1

:LIFTS_5
if
0039:   3@ == 1
004D: jump_if_false @LIFTS_7
if
0021:   13@ >  46.0  // floating-point values
004D: jump_if_false @LIFTS_6
034E:    move_object 1@ to -534.84 2632.83 45.0 speed 0.0 0.0 0.04 flag 0      
0002: jump @LIFTS_4

:LIFTS_6
0006: 3@ = 2
0001: wait 2000 ms
0002: jump @LIFTS_4

:LIFTS_7
if
0039:   3@ == 2
004D: jump_if_false @LIFTS_4
if
0023:   52.5 > 13@  // floating-point values
004D: jump_if_false @LIFTS_8
034E:    move_object 1@ to -534.84 2632.83 53.5 speed 0.0 0.0 0.04 flag 0
0002: jump @LIFTS_4

:LIFTS_8
0006: 3@ = 0
0001: wait 2000 ms
0002: jump @LIFTS_4

:LIFTS_13    
0108: destroy_object 1@
0108: destroy_object 2@
0002: jump @LIFTS_2


This crashes ;'( took it from here - http://www.gtaforums.com/index.php?showtop...entry1058556049

This post has been edited by kalonkas on Tuesday, Aug 21 2012, 18:10
PM
  Top
 

 
ZAZ  
Posted: Wednesday, Aug 22 2012, 18:34
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (kalonkas @ Tuesday, Aug 21 2012, 06:12)
Thanks for your help , i really appreciate it, but for now i leave that script , last thing - could you help me with your elevator script ?

i use your gates script, it works perfectly, but i want to make an lift with it. I put all coords right but i need that only Z coords move when i press a key, but it doesnt /:

This crashes ;'( took it from here - http://www.gtaforums.com/index.php?showtop...entry1058556049

the doorscript doesn't work anymore because you edited values, hoping the object would move vertical
but the script works only for object moving horizontal

model id 16795 and 16797 don't exist in originaly San Andreas
the member stripprpimp added 2 objects to his game as lift objects and asked for help to realize a special liftscript where you found that script

kalonkas, please don't post here anymore. Your way of learning scripting is wrong and your posts look like spam
please post in mission coding section


This post has been edited by ZAZ on Wednesday, Aug 22 2012, 18:45
Users WebsitePM
  Top
 

 
Michael-Knight1  
Posted: Thursday, Aug 23 2012, 15:09
Quote Post


Never Give UP
Group Icon
Group: Members
Joined: Jul 8, 2012

gr.gif

XXXXX



Hi Zaz , I Need Help into my kitt prison break on main script . i don't knew why the game crashed when i get spawned from the jail ?? Here is the codes !

CODE

016D: restart_if_busted_at 1410.453 -1586.943 13.549 angle 86.8 town_number 1


CODE

:BUSTED_LS
thread 'BUSTED_LS'
Audiostream.Load($PRISON_LSMP3, "CLEO\AUDIO\PRISON LOS SANTOS.MP3")
054C: use_GXT_table 'KRBTS'

:BUSTED_LS_69
wait 0
0842: $CURRENT_TOWN_NUMBER = player $PLAYER_CHAR town_number
if
0741:   actor $PLAYER_ACTOR busted
else_jump @BUSTED_LS_69
if or
 $CURRENT_TOWN_NUMBER == 1
 $CURRENT_TOWN_NUMBER == 0
else_jump @BUSTED_LS_69
Model.Load(#COPCARLA)
Model.Load(#LAPD1)
Model.Load(#M4)
038B: load_requested_models

:BUSTED_LS_139
wait 0
if and
  Model.Available(#COPCARLA)
  Model.Available(#LAPD1)
  Model.Available(#M4)
else_jump @BUSTED_LS_139
wait 5000
jump @BUSTED_LS_198

:BUSTED_LS_198
01EB: set_traffic_density_multiplier_to 0.0
03DE: set_pedestrians_density_multiplier_to 0.0
02A3: enable_widescreen 1
Camera.SetPosition(1505.497, -1713.624, 14.0469, 0.0, 0.0, 0.0)
Camera.PointAt(1551.765, -1674.273, 15.9855, 2)
$COPBUSTEDCAR_LS = Car.Create(#COPCARLA, 1414.08, -1589.726, 12.8785)
Car.Angle($COPBUSTEDCAR_LS) = 271.111
0397: enable_car $COPBUSTEDCAR_LS siren 1
0508: car $COPBUSTEDCAR_LS close_all_doors
Car.DoorStatus($COPBUSTEDCAR_LS) = 4
072B: put_actor $PLAYER_ACTOR into_car $COPBUSTEDCAR_LS passengerseat 1
0129: $COPBUSTEDPED1_LS = create_actor_pedtype 280 model #LAPD1 in_car $COPBUSTEDCAR_LS driverseat
01C8: $COPBUSTEDPED2_LS = create_actor_pedtype 280 model #LAPD1 in_car $COPBUSTEDCAR_LS passenger_seat 0
fade 0 5000
wait 8000
Player.CanMove($PLAYER_CHAR) = False
0918: unknown_car $COPBUSTEDCAR_LS driver_flag 1
0704: car $COPBUSTEDCAR_LS drive_to 1593.907 -1691.939 5.8906
Car.SetMaxSpeed($COPBUSTEDCAR_LS, 22.0)
Camera.Restore
00BB: show_text_lowpriority GXT 'PRLS_1' time 5000 flag 1  // ~r~Michael :~w~Please allow this time to leave me or let me call My Director
wait 5000
00BB: show_text_lowpriority GXT 'PRLS_2' time 5000 flag 1  // ~b~Cop 1 :~w~ Shut up Michael Knight
wait 5000
00BB: show_text_lowpriority GXT 'PRLS_3' time 5000 flag 1  // ~g~Cop 2 : ~w~ You should shut up and be serious because you will spend on the following few minute
wait 20000
0633: AS_actor $COPBUSTEDPED1_LS exit_car
0633: AS_actor $COPBUSTEDPED2_LS exit_car
0633: AS_actor $PLAYER_ACTOR exit_car
wait 2000
Camera.SetPosition(1593.85, -1699.281, 5.897, 0.0, 0.0, 0.0)
Camera.PointAt(1597.892, -1697.116, 5.8906, 2)
wait 2000
07CD: AS_actor $COPBUSTEDPED1_LS walk_to 1610.677 -1697.393 6.2187 stop_with_angle 270.0287 within_radius 1.0
07CD: AS_actor $COPBUSTEDPED2_LS walk_to 1596.614 -1693.773 5.8906 stop_with_angle 275.8371 within_radius 1.0
07CD: AS_actor $PLAYER_ACTOR walk_to 1610.642 -1693.271 6.2187 stop_with_angle 89.0653 within_radius 1.0
wait 1000
00BB: show_text_lowpriority GXT 'PRLS_4' time 5000 flag 1  // ~r~Michael : ~w~KITT It's the time or never !
wait 5000
00BB: show_text_lowpriority GXT 'PRLS_5' time 5000 flag 1  // ~b~KITT : ~w~Michael I Am On The Way !
wait 3000
0639: AS_actor $COPBUSTEDPED1_LS rotate_to_actor $PLAYER_ACTOR
0639: AS_actor $PLAYER_ACTOR rotate_to_actor $COPBUSTEDPED1_LS
$BUSTEDLS_M4 = 31
$BUSTEDLS_M4_AMMO = 500
01B2: give_actor $COPBUSTEDPED1_LS weapon $BUSTEDLS_M4 ammo $BUSTEDLS_M4_AMMO // Load the weapon model before using this
01B2: give_actor $COPBUSTEDPED2_LS weapon $BUSTEDLS_M4 ammo $BUSTEDLS_M4_AMMO // Load the weapon model before using this
0605: actor $COPBUSTEDPED1_LS perform_animation_sequence "GANG_GUNSTAND" IFP_file "PED" 4.0 loop 0 0 0 0 time 20000 // versionA
wait 3000
Car.PutAt($KITT, 1566.993, -1824.04, 12.8944)
Car.Angle($KITT) = 0.7787
0508: car $KITT close_all_doors
0129: $BUSTEDLS_INVPED = create_actor_pedtype 280 model #LAPD1 in_car $KITT driverseat
0337: set_actor $BUSTEDLS_INVPED visibility 0
0918: unknown_car $KITT driver_flag 1
0704: car $KITT drive_to 1603.881 -1690.354 5.4099
Car.SetMaxSpeed($KITT, 35.0)
wait 3000
Camera.Restore
Audiostream.PerformAction($PRISON_LSMP3, STOP)
Audiostream.PerformAction($PRISON_LSMP3, PLAY)
067A: put_camera_on_car $KITT with_offset 0.0 10.0 3.0 point_to_car $KITT tilt 5.0 2
wait 6000
067A: put_camera_on_car $KITT with_offset -4.0 -12.0 3.0 point_to_car $KITT tilt 5.0 2
wait 7500
05E2: AS_actor $COPBUSTEDPED1_LS kill_actor $BUSTEDLS_INVPED
05E2: AS_actor $COPBUSTEDPED2_LS kill_actor $BUSTEDLS_INVPED
Camera.SetPosition(1591.619, -1625.219, 13.3828, 0.0, 0.0, 0.0)
Camera.PointAt(1588.449, -1637.078, 13.4172, 2)
wait 3000
067A: put_camera_on_car $KITT with_offset -4.0 -12.0 3.0 point_to_car $KITT tilt 5.0 2
Car.SetMaxSpeed($KITT, 20.0)
wait 4000
00BB: show_text_lowpriority GXT 'PRLS_6' time 2000 flag 1  // ~b~KITT : ~w~Michael Jump in !
Camera.Restore_WithJumpCut
02A3: enable_widescreen 0
01EB: set_traffic_density_multiplier_to 2.0
03DE: set_pedestrians_density_multiplier_to 2.0
Camera.Restore_WithJumpCut
Player.CanMove($PLAYER_CHAR) = True
Player.WantedLevel($PLAYER_CHAR) = 2
Actor.DestroyInstantly($BUSTEDLS_INVPED)
08A6: set_car $KITT componentA 2 rotation_to 0.0
wait 10
08A6: set_car $KITT componentA 2 rotation_to 0.05
wait 10
08A6: set_car $KITT componentA 2 rotation_to 0.1
wait 10
08A6: set_car $KITT componentA 2 rotation_to 0.15
wait 10
08A6: set_car $KITT componentA 2 rotation_to 0.2
wait 10
08A6: set_car $KITT componentA 2 rotation_to 0.25
wait 10
08A6: set_car $KITT componentA 2 rotation_to 0.3
wait 10
08A6: set_car $KITT componentA 2 rotation_to 0.35
wait 10
08A6: set_car $KITT componentA 2 rotation_to 0.4
wait 10
08A6: set_car $KITT componentA 2 rotation_to 0.45
wait 10
08A6: set_car $KITT componentA 2 rotation_to 0.5
wait 10
08A6: set_car $KITT componentA 2 rotation_to 0.55
wait 10
08A6: set_car $KITT componentA 2 rotation_to 0.6
wait 10
08A6: set_car $KITT componentA 2 rotation_to 0.65
wait 10
08A6: set_car $KITT componentA 2 rotation_to 0.7
wait 10
08A6: set_car $KITT componentA 2 rotation_to 0.75
wait 10
08A6: set_car $KITT componentA 2 rotation_to 0.8
wait 10
08A6: set_car $KITT componentA 2 rotation_to 0.85
wait 10
08A6: set_car $KITT componentA 2 rotation_to 0.9
wait 10
08A6: set_car $KITT componentA 2 rotation_to 0.95
wait 10
08A6: set_car $KITT componentA 2 rotation_to 1.0
0918: unknown_car $KITT driver_flag 1
wait 2000
Audiostream.PerformAction($PRISON_LSMP3, STOP)
00BB: show_text_lowpriority GXT 'PRLS_7' time 2000 flag 1  // ~r~Michael : ~w~Thanks Pal.
wait 5000
Actor.RemoveReferences($COPBUSTEDPED1_LS)
Actor.RemoveReferences($COPBUSTEDPED2_LS)
Car.RemoveReferences($COPBUSTEDCAR_LS)
05E2: AS_actor $COPBUSTEDPED1_LS kill_actor $PLAYER_ACTOR
05E2: AS_actor $COPBUSTEDPED2_LS kill_actor $PLAYER_ACTOR
jump @BUSTED_LS_69
end_thread


Users WebsitePM
  Top
 

 
ZAZ  
Posted: Friday, Aug 24 2012, 12:40
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (Michael-Knight1 @ Thursday, Aug 23 2012, 16:09)
Hi Zaz , I Need Help into my kitt prison break on main script . i don't knew why the game crashed when i get spawned from the jail ?? Here is the codes !


280 isn't a pedtype as i mentioned in earlier post

don't use the actors handle after removing their reference
CODE
Actor.RemoveReferences($COPBUSTEDPED1_LS)
Actor.RemoveReferences($COPBUSTEDPED2_LS)
Car.RemoveReferences($COPBUSTEDCAR_LS)
05E2: AS_actor $COPBUSTEDPED1_LS kill_actor $PLAYER_ACTOR
05E2: AS_actor $COPBUSTEDPED2_LS kill_actor $PLAYER_ACTOR


your script then don't crash, you will just get a black screen because you did a fade but didn't fade back
Users WebsitePM
  Top
 

 

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

0 Members:

Pages: (31) « First ... 21 22 [23] 24 25 ... Last »

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



 
IMG IMG