Quantcast

Jump to content

» «
Photo

Need Help With A Script

84 replies to this topic
midou35000
  • midou35000

    Crackhead

  • Members
  • Joined: 04 Jul 2014
  • United-States

#61

Posted 26 July 2014 - 09:29 AM

Ok i left the AK47 its good:
{$CLEO .cs}

:ACTOR_01
03A4: name_thread 'Actor'

:ACTOR_02
0001: wait  0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @ACTOR_02
if
0AB0: key_pressed 78
004D: jump_if_false @ACTOR_02
0247: request_model 113
0247: request_model #AK47

:ACTOR_03
0001: wait  0 ms
00D6: if  and
0248:   model 113 available
0248:   model #AK47 available
004D: jump_if_false @ACTOR_03
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset -2.0 2.0 0.2
009A: 1@ = create_actor_pedtype 4 model 113 at 11@ 12@ 13@
0173: set_actor 1@ z_angle_to  90.0
01B2: give_actor 1@ weapon  30 ammo  1500  // Load the weapon model before using this
02E2: set_actor 1@ weapon_accuracy_to  100
0223: set_actor 1@ health_to  1000
05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR
0249: release_model 113

:ACTOR_04
0001: wait  0 ms
if
8118: NOT   actor 1@ dead
004D: jump_if_false @ACTOR_05
if
0104: actor $PLAYER_ACTOR near_actor 1@ radius  100.0  100.0  20.0 sphere  0
004D: jump_if_false @ACTOR_05
0002: jump @ACTOR_04

:ACTOR_05
01C2: remove_references_to_actor 1@ // Like turning an actor into a random pedestrian
0002: jump @ACTOR_02

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#62

Posted 26 July 2014 - 12:24 PM Edited by ZAZ, 26 July 2014 - 12:29 PM.

there's a player $PLAYER_CHAR defined check missing in the loop after spawning

midou35000
  • midou35000

    Crackhead

  • Members
  • Joined: 04 Jul 2014
  • United-States

#63

Posted 26 July 2014 - 12:37 PM Edited by midou35000, 27 July 2014 - 10:14 AM.

ZAZ, wich number shall i use? i just followed the number of the ak47 and i did the same thing to shotgspa here:
http://prntscr.com/46idyd
{$CLEO .cs}
 
:ACTOR_01
03A4: name_thread 'Actor'
 
:ACTOR_02
0001: wait  0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @ACTOR_02
if
0AB0: key_pressed 78
004D: jump_if_false @ACTOR_02
0247: request_model 113
0247: request_model #SHOTGSPA
 
:ACTOR_03
0001: wait  0 ms
00D6: if  and
0248:   model 113 available
0248:   model #SHOTGSPA available
004D: jump_if_false @ACTOR_03
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset -2.0 2.0 0.2
009A: 1@ = create_actor_pedtype 4 model 113 at 11@ 12@ 13@
0173: set_actor 1@ z_angle_to  90.0
01B2: give_actor 1@ weapon  27 ammo  1500  // Load the weapon model before using this
02E2: set_actor 1@ weapon_accuracy_to  100
0223: set_actor 1@ health_to  1000
05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR
0249: release_model 113
 
:ACTOR_04
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @ACTOR_05
if
8118: NOT   actor 1@ dead
004D: jump_if_false @ACTOR_05
0104: actor $PLAYER_ACTOR near_actor 1@ radius  100.0  100.0  20.0 sphere  0
004D: jump_if_false @ACTOR_05
0002: jump @ACTOR_04
 
:ACTOR_05
01C2: remove_references_to_actor 1@ // Like turning an actor into a random pedestrian
0002: jump @ACTOR_02

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#64

Posted 27 July 2014 - 09:31 AM

well done, just a tiny note: an "if" was lost by adding the player_defined check

if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @ACTOR_05
//--- here should be IF ---
8118: NOT   actor 1@ dead
004D: jump_if_false @ACTOR_05

but it isn't a problem because the compiler know that here should be a "if",
unless if there'e more than one condition per check, you know, then you have to determine if "if and" or "if or" is meant

 

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

 

About model loading:

you can enter the id number as well as the model name with # infront

so, the ped id: 113, MAFBOSS can also be called with #MAFBOSS

and the weapon id: 351, shotgspa can also be called with 351

0247: request_model #MAFBOSS
0247: request_model 351
 
:ACTOR_03
0001: wait  0 ms
00D6: if  and
0248:   model #MAFBOSS available
0248:   model 351 available
004D: jump_if_false @ACTOR_03

04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset -2.0 2.0 0.2
009A: 1@ = create_actor_pedtype 4 model #MAFBOSS at 11@ 12@ 13@
01B2: give_actor 1@ weapon  27 ammo  1500
0249: release_model #MAFBOSS
0249: release_model 351

ATTENTION: loading special actors needs other codes than loading peds

 

[Q] What's different of peds and special actors?

 

[A] peds are defined in peds.ide with ID number and model name (113, MAFBOSS)

special actors not, but there are ID numbers reserverd in peds.ide to assigne a ID number temporarelly (290 - 299)

so special actors need to be called allways by file name: 023C: load_special_actor 'TENPEN' as 1

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

 

 

Write now a script that spawns MAFBOSS and RYDER, one actor with AK47, the other with shotgun

 

 

 

 

  • midou35000 likes this

midou35000
  • midou35000

    Crackhead

  • Members
  • Joined: 04 Jul 2014
  • United-States

#65

Posted 14 August 2014 - 09:35 AM

ZAZ am stuck help me please.


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#66

Posted 14 August 2014 - 02:46 PM

where did you stuck?

midou35000
  • midou35000

    Crackhead

  • Members
  • Joined: 04 Jul 2014
  • United-States

#67

Posted 14 August 2014 - 03:35 PM Edited by midou35000, 14 August 2014 - 04:00 PM.

There is no RYDER model in peds.ide or shall i type?:
0247: request_model #RYDER
EDIT:Never Mind its a specialactor i should load with
023C: load_special_actor 'RYDER' as 1
you are so smart ZAZ and... do i have to ccheck if the model if availeble with opcode 0248.?
Here is what i got right now:
{$CLEO .cs}
 
:ACTOR_01
03A4: name_thread 'ActorS'
 
:ACTOR_02
0001: wait  0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @ACTOR_02
if
0AB0: key_pressed 78//------key N
004D: jump_if_false @ACTOR_02
0247: request_model 113
0247: request_model #SHOTGSPA
0247: request_model #AK47

:ACTOR_002
0001: wait 0 ms
00D6: if
823D:   not special_actor 1 loaded
004D: jump_if_false @ACTOR_0002
023C: load_special_actor 'RYDER' as 1

:ACTOR_0002
wait 0 ms
077E: get_active_interior_to 30@
023C: load_special_actor 'RYDER' as 1
 
:ACTOR_03
0001: wait  0 ms
00D6: if  and
0248:   model 113 available
0248:   model #SHOTGSPA available
0248:   model #AK47 available
004D: jump_if_false @ACTOR_03
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset -2.0 2.0 0.2
009A: 1@ = create_actor_pedtype 4 model 113 at 11@ 12@ 13@
0173: set_actor 1@ z_angle_to  90.0
01B2: give_actor 1@ weapon  27 ammo  1500  // Load the weapon model before using this
02E2: set_actor 1@ weapon_accuracy_to  100
0223: set_actor 1@ health_to  1000
05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR
0249: release_model 113
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset 2.0 -2.0 0.2
009A: 2@ = create_actor_pedtype 24 model #SPECIAL01 at 11@ 12@ 13@
0173: set_actor 2@ z_angle_to  90.0
01B2: give_actor 2@ weapon  30 ammo  1500  // Load the weapon model before using this
02E2: set_actor 1@ weapon_accuracy_to  100
0223: set_actor 2@ health_to 1000
0860: link_actor 2@ to_interior 30@
05E2: AS_actor 2@ kill_actor $PLAYER_ACTOR
0296: unload_special_actor 1
 
:ACTOR_04
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @ACTOR_05
if
8118: NOT   actor 1@ dead
004D: jump_if_false @ACTOR_05
0002: jump @ACTOR_04
 
:ACTOR_05
01C2: remove_references_to_actor 1@ // Like turning an actor into a random pedestrian
01C2: remove_references_to_actor 2@ // Like turning an actor into a random pedestrian
0002: jump @ACTOR_02

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#68

Posted 14 August 2014 - 07:57 PM

Not bad
You found out, RYDER isn't defined as ped but it's a special actor, needs to load with 023C: and check if loaded with 0248:
other model which have definitions in any *.ide file needs to load with 0247: and check if loaded with 0247: , vehicles, peds, objects, weapons
look into vehicles.ide, peds.ide, default.ide as well ide files of map folder
(tuningparts of veh_mods.ide can you also load in that way and spawn as object but to use it as tuningpart requires to load with 06E9: and check if loaded with 06EA:)

your problem is still to understand what a conditional check do
so let's focus this load check:
:ACTOR_002
0001: wait 0 ms
00D6: if
823D:   not special_actor 1 loaded
004D: jump_if_false @ACTOR_0002
023C: load_special_actor 'RYDER' as 1
what do you think, does the reading process do when it read this lines
00D6: if
823D:   not special_actor 1 loaded
004D: jump_if_false @ACTOR_0002
if not actor loaded, then ... ?
 
i think your answer will be: "if not actor loaded, then load_special_actor"
 
but we need it reverse:
first load the special actor with 023C: then check if it's loaded
and repeat the check as long as it's really loaded
to repeat the check needs to put the check in a LOOP
 
023C: load_special_actor 'RYDER' as 1

:LOAD_CHECK_LOOP
wait 0
if
023D:   special_actor 1 loaded
else_jump @LOAD_CHECK_LOOP
when the reading process reads the first time the conditional check 023D: special_actor 1 loaded, then the actor isn't loaded yet
and the else_jump leads the reading process to the label :LOAD_CHECK_LOOP
then it checks again and again, thausend times per second, it repeats the codes because it's a LOOP
and only if the actor is really loaded, then the check will be passed
 
you can it also do with NOT-version of the condition, but then you must build the jump instruction in another way
 
:LOAD_CHECK_LOOP
wait 0
if
823D: not  special_actor 1 loaded
else_jump @LOAD_CHECK_passed
023C: load_special_actor 'RYDER' as 1
jump @LOAD_CHECK_LOOP

:LOAD_CHECK_passed
009A: 2@ = create_actor_pedtype 24 model #SPECIAL01 at 11@ 12@ 13@
now it checks first if the actor isn't loaded and of course, this check will be passed immeadiately and the following code loads the actor,
BUT THEN, SEND the Reading process BACK TO LOOP ADRESS TO REPEAT THE CHECK

Whats wrong with your codes?
:ACTOR_002
0001: wait 0 ms
00D6: if
823D:   not special_actor 1 loaded
004D: jump_if_false @ACTOR_0002
023C: load_special_actor 'RYDER' as 1
it checks first if the actor isn't loaded and of course, this check will be passed immeadiately and the following code loads the actor
but it didn't repeat the check, the reading process instead continues the reading of the following codes
but the actor isn't loaded really at that moment when this code will be read:
009A: 2@ = create_actor_pedtype 24 model #SPECIAL01 at 11@ 12@ 13@
and cause a game crash
  • midou35000 likes this

midou35000
  • midou35000

    Crackhead

  • Members
  • Joined: 04 Jul 2014
  • United-States

#69

Posted 15 August 2014 - 09:44 AM

Ok What About Now:
{$CLEO .cs}
 
:ACTOR_01
03A4: name_thread 'ActorS'
 
:ACTOR_02
0001: wait  0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @ACTOR_02
if
0AB0: key_pressed 78//------key N
004D: jump_if_false @ACTOR_02
0247: request_model 113
0247: request_model #SHOTGSPA
0247: request_model #AK47

:ACTOR_002
0001: wait 0 ms
00D6: if
823D:   not special_actor 1 loaded
004D: jump_if_false @ACTOR_002
023C: load_special_actor 'RYDER' as 1
jump @ACTOR_0002

:ACTOR_0002
wait 0 ms
077E: get_active_interior_to 30@
023C: load_special_actor 'RYDER' as 1
 
:ACTOR_03
0001: wait  0 ms
00D6: if  and
0248:   model 113 available
0248:   model #SHOTGSPA available
0248:   model #AK47 available
004D: jump_if_false @ACTOR_03
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset -2.0 2.0 0.2
009A: 1@ = create_actor_pedtype 4 model 113 at 11@ 12@ 13@
0173: set_actor 1@ z_angle_to  90.0
01B2: give_actor 1@ weapon  27 ammo  1500  // Load the weapon model before using this
02E2: set_actor 1@ weapon_accuracy_to  100
0223: set_actor 1@ health_to  1000
05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR
0249: release_model 113
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset 2.0 -2.0 0.2
009A: 2@ = create_actor_pedtype 24 model #SPECIAL01 at 11@ 12@ 13@
0173: set_actor 2@ z_angle_to  90.0
01B2: give_actor 2@ weapon  30 ammo  1500  // Load the weapon model before using this
02E2: set_actor 1@ weapon_accuracy_to  100
0223: set_actor 2@ health_to 1000
0860: link_actor 2@ to_interior 30@
05E2: AS_actor 2@ kill_actor $PLAYER_ACTOR
0296: unload_special_actor 1
 
:ACTOR_04
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @ACTOR_05
if
8118: NOT   actor 1@ dead
004D: jump_if_false @ACTOR_05
0002: jump @ACTOR_04
 
:ACTOR_05
01C2: remove_references_to_actor 1@ // Like turning an actor into a random pedestrian
01C2: remove_references_to_actor 2@ // Like turning an actor into a random pedestrian
0002: jump @ACTOR_02

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#70

Posted 15 August 2014 - 10:48 AM

no, you didn't understand
your check:

:ACTOR_002 <------ adress "LOAD_CHECK_LOOP"
0001: wait 0 ms
00D6: if
823D:   not special_actor 1 loaded
004D: jump_if_false @ACTOR_002 <------ leads to adress "LOAD_CHECK_LOOP"
023C: load_special_actor 'RYDER' as 1
jump @ACTOR_0002<--- useless jump to adress "LOAD_CHECK_passed"

:ACTOR_0002 <-- adress "LOAD_CHECK_passed"

my advice:

:LOAD_CHECK_LOOP
wait 0
if
823D: not  special_actor 1 loaded
else_jump @LOAD_CHECK_passed
023C: load_special_actor 'RYDER' as 1
jump @LOAD_CHECK_LOOP

:LOAD_CHECK_passed
  • midou35000 likes this

midou35000
  • midou35000

    Crackhead

  • Members
  • Joined: 04 Jul 2014
  • United-States

#71

Posted 15 August 2014 - 11:10 AM

Oh yes My bad i have made a mistake in copy/paste, i did understand:
{$CLEO .cs}
 
:ACTOR_01
03A4: name_thread 'ActorS'
 
:ACTOR_02
0001: wait  0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @ACTOR_02
if
0AB0: key_pressed 78//------key N
004D: jump_if_false @ACTOR_02
0247: request_model 113
0247: request_model #SHOTGSPA
0247: request_model #AK47

:ACTOR_002
0001: wait 0 ms
00D6: if
823D:   not special_actor 1 loaded
004D: jump_if_false @ACTOR_0002
023C: load_special_actor 'RYDER' as 1
jump @ACTOR_002

:ACTOR_0002
wait 0 ms
077E: get_active_interior_to 30@
023C: load_special_actor 'RYDER' as 1
 
:ACTOR_03
0001: wait  0 ms
00D6: if  and
0248:   model 113 available
0248:   model #SHOTGSPA available
0248:   model #AK47 available
004D: jump_if_false @ACTOR_03
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset -2.0 2.0 0.2
009A: 1@ = create_actor_pedtype 4 model 113 at 11@ 12@ 13@
0173: set_actor 1@ z_angle_to  90.0
01B2: give_actor 1@ weapon  27 ammo  1500  // Load the weapon model before using this
02E2: set_actor 1@ weapon_accuracy_to  100
0223: set_actor 1@ health_to  1000
05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR
0249: release_model 113
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset 2.0 -2.0 0.2
009A: 2@ = create_actor_pedtype 24 model #SPECIAL01 at 11@ 12@ 13@
0173: set_actor 2@ z_angle_to  90.0
01B2: give_actor 2@ weapon  30 ammo  1500  // Load the weapon model before using this
02E2: set_actor 1@ weapon_accuracy_to  100
0223: set_actor 2@ health_to 1000
0860: link_actor 2@ to_interior 30@
05E2: AS_actor 2@ kill_actor $PLAYER_ACTOR
0296: unload_special_actor 1
 
:ACTOR_04
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @ACTOR_05
if
8118: NOT   actor 1@ dead
004D: jump_if_false @ACTOR_05
0002: jump @ACTOR_04
 
:ACTOR_05
01C2: remove_references_to_actor 1@ // Like turning an actor into a random pedestrian
01C2: remove_references_to_actor 2@ // Like turning an actor into a random pedestrian
0002: jump @ACTOR_02

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#72

Posted 15 August 2014 - 01:36 PM

ok, now remove the useless codes

:ACTOR_0002
wait 0 ms <-- useless
077E: get_active_interior_to 30@
023C: load_special_actor 'RYDER' as 1 <-- useless

then make the check in the loop after the spawning in this way that the code jumps to the cleanup only if both actors are dead

  • midou35000 likes this

midou35000
  • midou35000

    Crackhead

  • Members
  • Joined: 04 Jul 2014
  • United-States

#73

Posted 15 August 2014 - 01:41 PM

Like that:
{$CLEO .cs}
 
:ACTOR_01
03A4: name_thread 'ActorS'
 
:ACTOR_02
0001: wait  0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @ACTOR_02
if
0AB0: key_pressed 78//------key N
004D: jump_if_false @ACTOR_02
0247: request_model 113
0247: request_model #SHOTGSPA
0247: request_model #AK47

:ACTOR_002
0001: wait 0 ms
00D6: if
823D:   not special_actor 1 loaded
004D: jump_if_false @ACTOR_0002
023C: load_special_actor 'RYDER' as 1
jump @ACTOR_002

:ACTOR_0002
077E: get_active_interior_to 30@
else_jump @ACTOR_0002
 
:ACTOR_03
0001: wait  0 ms
00D6: if  and
0248:   model 113 available
0248:   model #SHOTGSPA available
0248:   model #AK47 available
004D: jump_if_false @ACTOR_03
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset -2.0 2.0 0.2
009A: 1@ = create_actor_pedtype 4 model 113 at 11@ 12@ 13@
0173: set_actor 1@ z_angle_to  90.0
01B2: give_actor 1@ weapon  27 ammo  1500  // Load the weapon model before using this
02E2: set_actor 1@ weapon_accuracy_to  100
0223: set_actor 1@ health_to  1000
05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR
0249: release_model 113
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset 2.0 -2.0 0.2
009A: 2@ = create_actor_pedtype 24 model #SPECIAL01 at 11@ 12@ 13@
0173: set_actor 2@ z_angle_to  90.0
01B2: give_actor 2@ weapon  30 ammo  1500  // Load the weapon model before using this
02E2: set_actor 1@ weapon_accuracy_to  100
0223: set_actor 2@ health_to 1000
0860: link_actor 2@ to_interior 30@
05E2: AS_actor 2@ kill_actor $PLAYER_ACTOR
0296: unload_special_actor 1
 
:ACTOR_04
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @ACTOR_05
if
8118: NOT   actor 1@ dead
004D: jump_if_false @ACTOR_05
0002: jump @ACTOR_04
 
:ACTOR_05
01C2: remove_references_to_actor 1@ // Like turning an actor into a random pedestrian
01C2: remove_references_to_actor 2@ // Like turning an actor into a random pedestrian
0002: jump @ACTOR_02

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#74

Posted 15 August 2014 - 03:08 PM Edited by ZAZ, 15 August 2014 - 04:15 PM.

what should that be? i think we give it up


midou35000
  • midou35000

    Crackhead

  • Members
  • Joined: 04 Jul 2014
  • United-States

#75

Posted 15 August 2014 - 03:13 PM

What do you mean?


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#76

Posted 15 August 2014 - 04:16 PM

:ACTOR_0002
077E: get_active_interior_to 30@
else_jump @ACTOR_0002  <------------------ i mean this

midou35000
  • midou35000

    Crackhead

  • Members
  • Joined: 04 Jul 2014
  • United-States

#77

Posted 15 August 2014 - 04:23 PM Edited by midou35000, 15 August 2014 - 04:24 PM.

Sorry dude


Ok could you explain more about what you said in the last post that you asked to make the check loop.


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#78

Posted 15 August 2014 - 07:12 PM

doesn't matter what i said, what did you think you were doing, as you put that else_jump there?


midou35000
  • midou35000

    Crackhead

  • Members
  • Joined: 04 Jul 2014
  • United-States

#79

Posted 16 August 2014 - 09:03 AM

Isnt else_jump is like jump_if_false??


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#80

Posted 16 August 2014 - 10:00 AM

yes and what sense does it make at that position?


midou35000
  • midou35000

    Crackhead

  • Members
  • Joined: 04 Jul 2014
  • United-States

#81

Posted 16 August 2014 - 10:02 AM

I dont know you told me to make a conditional check :p


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#82

Posted 16 August 2014 - 10:09 AM

and where is the condition of your imaginary conditional check?

Spoiler

 


midou35000
  • midou35000

    Crackhead

  • Members
  • Joined: 04 Jul 2014
  • United-States

#83

Posted 16 August 2014 - 10:11 AM

Dude ive got confused plz help me  :panic:


jayd00
  • jayd00

    Rat

  • Members
  • Joined: 24 May 2008

#84

Posted 19 August 2014 - 02:18 AM Edited by jayd00, 19 August 2014 - 02:20 AM.

and where is the condition of your imaginary conditional check?

Spoiler

 

jajaja I was like :O  :blink:  woow... you really have a big patient!  :cookie:  :cookie:

 

Dude ive got confused plz help me  :panic:

test this;

 

{$CLEO}
thread 'ActorS'

:start_code

while true
if  0256:   player $PLAYER_CHAR defined
then
    if 0AB0:   key_pressed 78//------key N
    then break 
    end
end
 wait 0
end


/// load models  
023C: load_special_actor 'RYDER' as 1
0247: request_model 113
0247: request_model #SHOTGSPA
0247: request_model #AK47


while true
if and 
823D:  not special_actor 1 loaded
8248:  not model 113 available
8248:  not model #SHOTGSPA available
8248:  not model #AK47 available
jf break
 wait 0
end


///  create the 3d Models
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset -2.0 2.0 0.2
009A: 1@ = create_actor_pedtype 4 model 113 at 11@ 12@ 13@
0173: set_actor 1@ z_angle_to 90.0
01B2: give_actor 1@ weapon 27 ammo 1500  // Load the weapon model before using this
02E2: set_actor 1@ weapon_accuracy_to 100
0223: set_actor 1@ health_to 1000


04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset 2.0 -2.0 0.2
009A: 2@ = create_actor_pedtype 24 model #SPECIAL01 at 11@ 12@ 13@
0173: set_actor 2@ z_angle_to 90.0
01B2: give_actor 2@ weapon 30 ammo 1500  // Load the weapon model before using this
02E2: set_actor 2@ weapon_accuracy_to 100
0223: set_actor 2@ health_to 1000


// release models
0249: release_model 113
0296: unload_special_actor 1
0249: release_model #SHOTGSPA
0249: release_model #AK47


// give new tasks to new actors
05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR
05E2: AS_actor 2@ kill_actor $PLAYER_ACTOR


// check if someone is dead
while true
if  8256: not player $PLAYER_CHAR defined    // if wasted/busted
then  break 
end


if 056D:   actor 1@ defined
then 
    if  0118:   actor 1@ dead
    then  01C2: remove_references_to_actor 1@ // Like turning an actor into a random pedestrian
    end
end


if 056D:   actor 2@ defined
then 
    if  0118:   actor 2@ dead
    then  01C2: remove_references_to_actor 2@ // Like turning an actor into a random pedestrian
    end
end


if and        /// both are dead!
856D:  not actor 1@ defined
856D:  not actor 2@ defined
then  break
end
 wait 0
end


/// last checks, to be sure both actors are dead, if not, turning them into a random pedestrian 
if  056D:   actor 1@ defined
then  
    01C2: remove_references_to_actor 1@ // Like turning an actor into a random pedestrian
end
if 056D:   actor 2@ defined
then
    01C2: remove_references_to_actor 2@ // Like turning an actor into a random pedestrian
end

wait 2000
goto @start_code
instructions;
-copy & paste into sanny builder 
-compile & put a name
- locate the .cs file
-decompile the file and "Magic"
-you will understand now.   ;)
 
study the code... and test it by yourself.
and a good advice will be that you keep order in your scripts ;)

good luck ;)

  • midou35000 likes this

midou35000
  • midou35000

    Crackhead

  • Members
  • Joined: 04 Jul 2014
  • United-States

#85

Posted 19 August 2014 - 09:10 AM

ZAZ, Sorry For That i know what was my mistake and thanks jayd00:
{$CLEO .cs}

//-------------MAIN---------------
03A4: name_thread 'ACTORS' 

:ACTORS_11
0001: wait  0 ms
if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @ACTORS_11 
if 
0AB0:   key_pressed 78 //-------key N  
004D: jump_if_false @ACTORS_11 

:ACTORS_60
023C: load_special_actor 'RYDER' as 1
0247: load_model #MAFBOSS 
0247: load_model #SHOTGSPA 
0247: load_model #AK47 

:ACTORS_87
00D6: if and
823D:   not special_actor 1 loaded 
8248:   not model #MAFBOSS available 
8248:   not model #SHOTGSPA available 
8248:   not model #AK47 available 
004D: jump_if_false @ACTORS_127 
0001: wait 0 ms 
0002: jump @ACTORS_87 

:ACTORS_127
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset -2.0 2.0 0.2 
009A: 1@ = create_actor_pedtype 4 model #MAFBOSS at 11@ 12@ 13@ 
0173: set_actor 1@ Z_angle_to 90.0 
01B2: give_actor 1@ weapon 27 ammo 1500 // Load the weapon model before using this 
02E2: set_actor 1@ weapon_accuracy_to 100 
0223: set_actor 1@ health_to 1000 
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset 2.0 -2.0 0.2 
009A: 2@ = create_actor_pedtype 24 model #SPECIAL01 at 11@ 12@ 13@ 
0173: set_actor 2@ Z_angle_to 90.0 
01B2: give_actor 2@ weapon 30 ammo 1500 // Load the weapon model before using this 
02E2: set_actor 2@ weapon_accuracy_to 100 
0223: set_actor 2@ health_to 1000 
0249: release_model #MAFBOSS 
0296: unload_special_actor 1 
0249: release_model #SHOTGSPA 
0249: release_model #AK47 
05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR 
05E2: AS_actor 2@ kill_actor $PLAYER_ACTOR 

:ACTORS_326
00D6: if 
8256:   not player $PLAYER_CHAR defined 
004D: jump_if_false @ACTORS_349 
0002: jump @ACTORS_462 

:ACTORS_349
00D6: if 
056D:   actor 1@ defined 
004D: jump_if_false @ACTORS_386 
00D6: if 
0118:   actor 1@ dead 
004D: jump_if_false @ACTORS_386 
01C2: remove_references_to_actor 1@ // Like turning an actor into a random pedestrian 

:ACTORS_386
00D6: if 
056D:   actor 2@ defined 
004D: jump_if_false @ACTORS_423 
00D6: if 
0118:   actor 2@ dead 
004D: jump_if_false @ACTORS_423 
01C2: remove_references_to_actor 2@ // Like turning an actor into a random pedestrian 

:ACTORS_423
00D6: if and
856D:   not actor 1@ defined 
856D:   not actor 2@ defined 
004D: jump_if_false @ACTORS_386 

:ACTORS_462
00D6: if 
056D:   actor 1@ defined 
004D: jump_if_false @ACTORS_462 
01C2: remove_references_to_actor 1@ // Like turning an actor into a random pedestrian 

:ACTORS_483
00D6: if 
056D:   actor 2@ defined 
004D: jump_if_false @ACTORS_483 
01C2: remove_references_to_actor 2@ // Like turning an actor into a random pedestrian 
0002: jump @ACTORS_11




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users