Quantcast

Jump to content

» «
Photo

[GTA SA] ~ CLEO Script Tutorial ~

635 replies to this topic
Joni2030
  • Joni2030

    Prankster

  • Members
  • Joined: 06 Jul 2011

#361

Posted 20 February 2012 - 09:41 AM

QUOTE (kal-el5676 @ Sunday, May 16 2010, 03:48)
QUOTE (ZAZ @ May 17 2009, 19:07)
Ups, visitors. Thx friends.
QUOTE (noelgamo @ May 15 2009, 07:55)

uhm how to make savepoints? cause I dont think I seen one from the tut. but if there is can you tell me wich bit is it.sorry for being a noob. smile.gif   smile.gif

Right, I forgot it.
Here it is:
The classic savescript with savedisk_pickup needs to insert 3 coords points.
One for the savedisk_pickup
One for the spawnpoint beside the pickup
One for the radar marker(If the savedisk is in an interior the location of the radar marker can be very different to pickup)

The savepoint of the script below is in the Atrium of Los Santos/Commerce
CODE
{$CLEO .cs}
:SAVE_1
03A4: name_thread 'SAVE'
0A95: enable_thread_saving
0570: 1@ = create_asset_radar_marker_with_icon 35 at 1722.2682 -1647.6366 42.4687
018B: show_on_radar 1@ 2

:SAVE_2
0001: wait 0 ms
0213: 2@ = create_pickup 1277 type 3 at 1720.7397 -1645.6292 20.2267

:SAVE_5
0001: wait 0 ms
00D6: if 0
0256: player $PLAYER_CHAR defined
004D: jump_if_false @SAVE_5
00D6: if 0
0214: pickup 2@ picked_up
004D: jump_if_false @SAVE_5
0050: gosub @SAVE_14
0002: jump @SAVE_2

:SAVE_14
00D6: if  0
0038:   $ONMISSION ==  0  // integer values
004D: jump_if_false @SAVE_17
0004: $ONMISSION =  1  // integer values
01B4: set_player $PLAYER_CHAR frozen_state  0 (frozen)
0001: wait  350 ms
03D8: show_SAVE_screen

:SAVE_15
00D6: if  0
83D9:   NOT   save_done
004D: jump_if_false @SAVE_16
0001: wait  0 ms
0002: jump @SAVE_15

:SAVE_16
00A1: put_actor $PLAYER_ACTOR at 1724.3228 -1646.5193 20.2272
0173: set_actor $PLAYER_ACTOR z_angle_to 176.8
01B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)
0004: $ONMISSION =  1  // integer values
0001: wait  350 ms
0004: $ONMISSION =  0  // integer values

:SAVE_17
0051: return


So much $ONMISSION = 0 and $ONMISSION = 1
Yes its nesssary. Otherwise the colored gangwar teritories will not be shown if a save was done while gangwar is activ.

And again the same script but in the kind of "decompilation without opcodes ":
CODE
{$CLEO .cs}
:SAVE_1
thread 'SAVE'
0A95: enable_thread_saving
0570: 1@ = create_asset_radar_marker_with_icon 35 at 1722.268 -1647.637 42.4687
018B: set_marker 1@ radar_mode 2

:SAVE_42
wait 0
2@ = Pickup.Create(1277, 3, 1720.74, -1645.629, 20.2267)

:SAVE_71
wait 0
if
  Player.Defined($PLAYER_CHAR)
else_jump @SAVE_71
if
  Pickup.Picked_up(2@)
else_jump @SAVE_71
gosub @SAVE_121
jump @SAVE_42

:SAVE_121
if
 $ONMISSION == 0
else_jump @SAVE_240
$ONMISSION = 1
Player.CanMove($PLAYER_CHAR) = False
wait 350
03D8: show_save_screen

:SAVE_160
if
83D9:   not save_done
else_jump @SAVE_184
wait 0
jump @SAVE_160

:SAVE_184
Actor.PutAt($PLAYER_ACTOR, 1724.323, -1646.519, 20.2272)
Actor.Angle($PLAYER_ACTOR) = 176.8
Player.CanMove($PLAYER_CHAR) = True
$ONMISSION = 1
wait 350
$ONMISSION = 0

:SAVE_240
return

This doesn't seem to work for me. i try to compile and it says not enough parameters, expected 5.

Are you sure? Because when I copy that code and compile it, I don't have any errors. Are you sure you copied it right?

Joni2030
  • Joni2030

    Prankster

  • Members
  • Joined: 06 Jul 2011

#362

Posted 21 February 2012 - 07:22 AM

Will be able to do so now that if I want the gun somewhere. But I would like that I need enough money that I can take the gun. Is it possible?

RRUBY0
  • RRUBY0

    Player Hater

  • Members
  • Joined: 22 Feb 2012

#363

Posted 29 February 2012 - 01:36 AM

ZAZ u have no idea how many people u helped with this inlove.gif inlove.gif

ZAZ
  • ZAZ

    Kernlochbohrer

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

#364

Posted 29 February 2012 - 05:06 PM

QUOTE (RRUBY0 @ Wednesday, Feb 29 2012, 01:36)
ZAZ u have no idea how many people u helped with this inlove.gif   inlove.gif

No, not really. Thanks for nice reply.

Joni2030
  • Joni2030

    Prankster

  • Members
  • Joined: 06 Jul 2011

#365

Posted 05 March 2012 - 05:57 PM

Thanks ZAZ Now Ii start read again and AGAIN every day and think it all and start some day mod project and again THANKS ZAZ you safe my life biggrin.gif

kal-el5676
  • kal-el5676

    Zombie Killa

  • Members
  • Joined: 02 Nov 2008

#366

Posted 09 March 2012 - 08:47 PM

QUOTE (ZAZ @ Sunday, Sep 5 2010, 15:24)


Try the sript below, I assume that you have the required paths and traffic.
Shure the actor isn't a dino but the example with the actor which kills the player shows the effect of the spawning
and the command to kill player give it more dynamic alien.gif
Set the marker mode to 2 because with marker above actor you will see him in any case if you drive fast
CODE
{$CLEO .cs}
:Spawn_by_random_actor_or_car
thread 'SPAWNAC'

:Spawn_1
0001: wait 0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @Spawn_1
077E: get_active_interior_to 29@
if  and//-----check several situations when the spawning don't makes sense
0039:   29@ ==  0  // integer values
8965:  not actor $PLAYER_ACTOR swimming
84A7:   not actor $PLAYER_ACTOR driving_boat
89AE:   not actor $PLAYER_ACTOR driving_train
004D: jump_if_false @Spawn_1  
0819: 30@ = actor $PLAYER_ACTOR distance_from_ground
if
0023:   20.0 > 30@
004D: jump_if_false @Spawn_1
0006: 1@ =  -1  // integer values
if
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false @Spawn_3
0050: gosub @Spawn_searchCarsub_1//leads the readingprocess to a subscript
//the readingprocess continues here with reading as soon as the return of the subscript is readed
if
8039:   NOT   1@ ==  -1  // checks if a radondom actor was found to get his coords
004D: jump_if_false @Spawn_1
0006: 1@ =  -1  // integer values
0002: jump @Spawn_Actor1

:Spawn_3
0050: gosub @Spawn_searchPedsub_1//leads the readingprocess to a subscript
//the readingprocess continues here with reading as soon as the return of the subscript is readed
if
8039:   NOT   1@ ==  -1  // checks if a radondom actor was found to get his coords
004D: jump_if_false @Spawn_1
01C2: remove_references_to_actor 1@
0006: 1@ =  -1  // integer values
0002: jump @Spawn_Actor1



:Spawn_Actor1
0247: request_model #WMOICE
0247: request_model #AK47

:Spawn_Actor3
0001: wait  0 ms
00D6: if  and
0248:   model #WMOICE available
0248:   model #AK47 available
004D: jump_if_false @Spawn_Actor3

009A: 2@ = create_actor  24 #WMOICE at  25@ 26@ 27@
0173: set_actor 2@ z_angle_to  0.0
01B2: give_actor 2@ weapon  30 ammo  99999  // Load the weapon model before using this
02E2: set_actor 2@ weapon_accuracy_to  100//decrease this value if you don't want to be killed
0223: set_actor 2@ health_to  1000
0946: set_actor 2@ actions_uninterupted_by_weapon_fire 1
060B: set_actor 2@ decision_maker_to 32
0187: 5@ = create_marker_above_actor 2@
018B: set_marker 5@ radar_mode 3//set marker to mode 2 to show it only on radar
05E2: AS_actor 2@ kill_actor $PLAYER_ACTOR
0249: release_model #WMOICE


:Spawn_action_Loop
0001: wait 0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @Spawn_Cleanup
if and
8118:   NOT   actor 2@ dead
0104:   actor $PLAYER_ACTOR near_actor 2@ radius  80.0  80.0  10.0 sphere  0
004D: jump_if_false @Spawn_Cleanup
0002: jump @Spawn_action_Loop

:Spawn_Cleanup
0164: disable_marker 5@
01C2: remove_references_to_actor 2@

:Spawn_Restart// an extra loop to give a delay after Player respawn
0001: wait 0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @Spawn_Restart
wait 2000
0002: jump @Spawn_1





:Spawn_searchCarsub_1//subscript must end with 0051: return
04C4: create_coordinate 14@ 15@ 16@ from_actor $PLAYER_ACTOR offset -100.0  70.0  0.0// increase the y-offset
04C4: create_coordinate 18@ 19@ 30@ from_actor $PLAYER_ACTOR offset  100.0  150.0  0.0
053E: 0@ = get_random_car_with_model -1 in_rectangle_cornerA 14@ 15@ cornerB 18@ 19@
0001: wait  50 ms
if
8039:   NOT   0@ ==  -1  // integer values
004D: jump_if_false @Spawn_searchCarsub_3
0001: wait  50 ms
0407: create_coordinate 25@ 26@ 27@ from_car 0@ with_offset 0.0 0.0 1.0
0001: wait  50 ms
00A6: destroy_car 0@
0001: wait  250 ms
0006: 1@ =  1  // integer values

:Spawn_searchCarsub_3
0051: return





:Spawn_searchPedsub_1//subscript must end with 0051: return
if
80E1:   not player 0 pressed_key 19
004D: jump_if_false @Spawn_searchPedsub_5
04C4: create_coordinate 14@ 15@ 16@ from_actor $PLAYER_ACTOR offset  0.0  0.0 0.0
068D: get_camera_position_to 18@ 19@ 30@
0087: 21@ = 18@  // floating-point values only
0087: 22@ = 19@  // floating-point values only
0087: 30@ = 18@  // floating-point values only
0087: 31@ = 19@  // floating-point values only
0063: 30@ -= 14@  // floating-point values
0063: 31@ -= 15@  // floating-point values
0013: 30@ *=  -2.0  // floating-point values
0013: 31@ *=  -2.0  // floating-point values
005B: 18@ += 30@  // floating-point values
005B: 19@ += 31@  // floating-point values
0063: 18@ -= 14@  // floating-point values
0063: 19@ -= 15@  // floating-point values
0013: 18@ *=  -15.0  // floating-point values
0013: 19@ *=  -15.0  // floating-point values
005B: 21@ += 18@  // floating-point values
005B: 22@ += 19@  // floating-point values
08E5: get_actor_in_sphere 21@ 22@ 16@ radius 31.5 handle_as 1@
0001: wait  50 ms
if
8039:   NOT   1@ ==  -1  // integer values
004D: jump_if_false @Spawn_searchPedsub_5
if
00DF: actor 1@ driving
004D: jump_if_false @Spawn_searchPedsub_3
04C4: store_coords_to 25@ 26@ 27@ from_actor 1@ with_offset -2.5 0.0 0.5
0002: jump @Spawn_searchPedsub_5

:Spawn_searchPedsub_3
04C4: store_coords_to 25@ 26@ 27@ from_actor 1@ with_offset -0.5 0.0 0.0

:Spawn_searchPedsub_5
0051: return

Zaz, sorry if this seems odd or late but i was wondering if this code could be activated with a mission marker along with a play audio file opcode? Once activated i would prefer to keep it enabled. Sort of a step into mission marker, hear the audio file, then the ped spawns constantly and attacks.

ZAZ
  • ZAZ

    Kernlochbohrer

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

#367

Posted 10 March 2012 - 08:45 PM

QUOTE (kal-el5676 @ Friday, Mar 9 2012, 20:47)

Zaz, sorry if this seems odd or late but i was wondering if this code could be activated with a mission marker along with a play audio file opcode? Once activated i would prefer to keep it enabled. Sort of a step into mission marker, hear the audio file, then the ped spawns constantly and attacks.

add a check for "if player is near point in sphere 1"
CODE
:Spawn_1
0001: wait 0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @Spawn_1
if
00FE:   actor $PLAYER_ACTOR near_point 1 in_sphere 2491.5  -1667.5  13.35 radius 3.0 3.0 3.0
004D: jump_if_false @Spawn_1


and a sound code when all checks are passed
CODE
if
0023:   20.0 > 30@
004D: jump_if_false @Spawn_1
0006: 1@ =  -1  // integer values
097A: play_audio_at 0.0 0.0 0.0 event 1057

kal-el5676
  • kal-el5676

    Zombie Killa

  • Members
  • Joined: 02 Nov 2008

#368

Posted 15 March 2012 - 08:40 PM

Thanks Zaz, but it would seem it only creates a marker and when the player steps out it simply reappears and nothing else happens. Also i was hoping to play an audio file from a specified folder.

CODE
{$CLEO .cs}
:Spawn_by_random_actor_or_car
thread 'SPAWNAC'

:Spawn_1
0001: wait 0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @Spawn_1
if
00FE:   actor $PLAYER_ACTOR near_point 1 in_sphere -761.4051 -2040.5336 9.8266 radius 1.0 1.0 1.0
004D: jump_if_false @Spawn_1
077E: get_active_interior_to 29@
if  and//-----check several situations when the spawning don't makes sense
0039:   29@ ==  0  // integer values
8965:  not actor $PLAYER_ACTOR swimming
84A7:   not actor $PLAYER_ACTOR driving_boat
89AE:   not actor $PLAYER_ACTOR driving_train
004D: jump_if_false @Spawn_1  
0819: 30@ = actor $PLAYER_ACTOR distance_from_ground
if
0023:   20.0 > 30@
004D: jump_if_false @Spawn_1
0006: 1@ =  -1  // integer values
if
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false @Spawn_3
0050: gosub @Spawn_searchCarsub_1//leads the readingprocess to a subscript
//the readingprocess continues here with reading as soon as the return of the subscript is readed
if
8039:   NOT   1@ ==  -1  // checks if a radondom actor was found to get his coords
004D: jump_if_false @Spawn_1
0006: 1@ =  -1  // integer values
0002: jump @Spawn_Actor1

:Spawn_3
0050: gosub @Spawn_searchPedsub_1//leads the readingprocess to a subscript
//the readingprocess continues here with reading as soon as the return of the subscript is readed
if
8039:   NOT   1@ ==  -1  // checks if a radondom actor was found to get his coords
004D: jump_if_false @Spawn_1
01C2: remove_references_to_actor 1@
0006: 1@ =  -1  // integer values
0002: jump @Spawn_Actor1



:Spawn_Actor1
0247: request_model #WMOICE
0247: request_model #AK47

:Spawn_Actor3
0001: wait  0 ms
00D6: if  and
0248:   model #WMOICE available
0248:   model #AK47 available
004D: jump_if_false @Spawn_Actor3

009A: 2@ = create_actor  24 #WMOICE at  25@ 26@ 27@
0173: set_actor 2@ z_angle_to  0.0
01B2: give_actor 2@ weapon  30 ammo  99999  // Load the weapon model before using this
02E2: set_actor 2@ weapon_accuracy_to  100//decrease this value if you don't want to be killed
0223: set_actor 2@ health_to  1000
0946: set_actor 2@ actions_uninterupted_by_weapon_fire 1
060B: set_actor 2@ decision_maker_to 32
0187: 5@ = create_marker_above_actor 2@
018B: set_marker 5@ radar_mode 3//set marker to mode 2 to show it only on radar
05E2: AS_actor 2@ kill_actor $PLAYER_ACTOR
0249: release_model #WMOICE


:Spawn_action_Loop
0001: wait 0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @Spawn_Cleanup
if and
8118:   NOT   actor 2@ dead
0104:   actor $PLAYER_ACTOR near_actor 2@ radius  80.0  80.0  10.0 sphere  0
004D: jump_if_false @Spawn_Cleanup
0002: jump @Spawn_action_Loop

:Spawn_Cleanup
0164: disable_marker 5@
01C2: remove_references_to_actor 2@

:Spawn_Restart// an extra loop to give a delay after Player respawn
0001: wait 0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @Spawn_Restart
wait 2000
0002: jump @Spawn_1





:Spawn_searchCarsub_1//subscript must end with 0051: return
04C4: create_coordinate 14@ 15@ 16@ from_actor $PLAYER_ACTOR offset -100.0  70.0  0.0// increase the y-offset
04C4: create_coordinate 18@ 19@ 30@ from_actor $PLAYER_ACTOR offset  100.0  150.0  0.0
053E: 0@ = get_random_car_with_model -1 in_rectangle_cornerA 14@ 15@ cornerB 18@ 19@
0001: wait  50 ms
if
8039:   NOT   0@ ==  -1  // integer values
004D: jump_if_false @Spawn_searchCarsub_3
0001: wait  50 ms
0407: create_coordinate 25@ 26@ 27@ from_car 0@ with_offset 0.0 0.0 1.0
0001: wait  50 ms
00A6: destroy_car 0@
0001: wait  250 ms
0006: 1@ =  1  // integer values

:Spawn_searchCarsub_3
0051: return





:Spawn_searchPedsub_1//subscript must end with 0051: return
if
80E1:   not player 0 pressed_key 19
004D: jump_if_false @Spawn_searchPedsub_5
04C4: create_coordinate 14@ 15@ 16@ from_actor $PLAYER_ACTOR offset  0.0  0.0 0.0
068D: get_camera_position_to 18@ 19@ 30@
0087: 21@ = 18@  // floating-point values only
0087: 22@ = 19@  // floating-point values only
0087: 30@ = 18@  // floating-point values only
0087: 31@ = 19@  // floating-point values only
0063: 30@ -= 14@  // floating-point values
0063: 31@ -= 15@  // floating-point values
0013: 30@ *=  -2.0  // floating-point values
0013: 31@ *=  -2.0  // floating-point values
005B: 18@ += 30@  // floating-point values
005B: 19@ += 31@  // floating-point values
0063: 18@ -= 14@  // floating-point values
0063: 19@ -= 15@  // floating-point values
0013: 18@ *=  -15.0  // floating-point values
0013: 19@ *=  -15.0  // floating-point values
005B: 21@ += 18@  // floating-point values
005B: 22@ += 19@  // floating-point values
08E5: get_actor_in_sphere 21@ 22@ 16@ radius 31.5 handle_as 1@
0001: wait  50 ms
if
8039:   NOT   1@ ==  -1  // integer values
004D: jump_if_false @Spawn_searchPedsub_5
if
00DF: actor 1@ driving
004D: jump_if_false @Spawn_searchPedsub_3
04C4: store_coords_to 25@ 26@ 27@ from_actor 1@ with_offset -2.5 0.0 0.5
0002: jump @Spawn_searchPedsub_5

:Spawn_searchPedsub_3
04C4: store_coords_to 25@ 26@ 27@ from_actor 1@ with_offset -0.5 0.0 0.0

:Spawn_searchPedsub_5
0051: return

ZAZ
  • ZAZ

    Kernlochbohrer

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

#369

Posted 17 March 2012 - 05:45 AM Edited by ZAZ, 01 May 2012 - 10:50 PM.

QUOTE (kal-el5676 @ Thursday, Mar 15 2012, 20:40)
Thanks Zaz, but it would seem it only creates a marker and when the player steps out it simply reappears and nothing else happens. Also i was hoping to play an audio file from a specified folder.

Because the game don't find random actors or cars in "Back o Beyond" to get spawn coords.
You have to use another method

change this parts:
CODE
if
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false @Spawn_3
0050: gosub @Spawn_searchCarsub_1//leads the readingprocess to a subscript
//the readingprocess continues here with reading as soon as the return of the subscript is readed
if
8039:   NOT   1@ ==  -1  // checks if a radondom actor was found to get his coords
004D: jump_if_false @Spawn_1
0006: 1@ =  -1  // integer values
0002: jump @Spawn_Actor1

:Spawn_3
0050: gosub @Spawn_searchPedsub_1//leads the readingprocess to a subscript
//the readingprocess continues here with reading as soon as the return of the subscript is readed
if
8039:   NOT   1@ ==  -1  // checks if a radondom actor was found to get his coords
004D: jump_if_false @Spawn_1
01C2: remove_references_to_actor 1@
0006: 1@ =  -1  // integer values
0002: jump @Spawn_Actor1



:Spawn_Actor1
0247: request_model #WMOICE
0247: request_model #AK47

:Spawn_Actor3
0001: wait  0 ms
00D6: if  and
0248:   model #WMOICE available
0248:   model #AK47 available
004D: jump_if_false @Spawn_Actor3

009A: 2@ = create_actor  24 #WMOICE at  25@ 26@ 27@
0173: set_actor 2@ z_angle_to  0.0
01B2: give_actor 2@ weapon  30 ammo  99999  // Load the weapon model before using this
02E2: set_actor 2@ weapon_accuracy_to  100//decrease this value if you don't want to be killed
0223: set_actor 2@ health_to  1000
0946: set_actor 2@ actions_uninterupted_by_weapon_fire 1
060B: set_actor 2@ decision_maker_to 32
0187: 5@ = create_marker_above_actor 2@
018B: set_marker 5@ radar_mode 2//set marker to mode 2 to show it only on radar
05E2: AS_actor 2@ kill_actor $PLAYER_ACTOR
0249: release_model #WMOICE


into this:

_PostMark
CODE
097A: play_audio_at 0.0 0.0 0.0 event 1057
04C4: create_coordinate 25@ 26@ 27@ from_actor $PLAYER_ACTOR offset 10.0  4.0  0.2

:Spawn_Actor1
0247: request_model #WMOICE
0247: request_model #AK47

:Spawn_Actor3
0001: wait  0 ms
00D6: if  and
0248:   model #WMOICE available
0248:   model #AK47 available
004D: jump_if_false @Spawn_Actor3

009A: 2@ = create_actor  24 #WMOICE at  25@ 26@ 27@
0173: set_actor 2@ z_angle_to  0.0
01B2: give_actor 2@ weapon  30 ammo  99999  // Load the weapon model before using this
02E2: set_actor 2@ weapon_accuracy_to  100//decrease this value if you don't want to be killed
0223: set_actor 2@ health_to  1000
0946: set_actor 2@ actions_uninterupted_by_weapon_fire 1
060B: set_actor 2@ decision_maker_to 32
0187: 5@ = create_marker_above_actor 2@
018B: set_marker 5@ radar_mode 2//set marker to mode 2 to show it only on radar

0249: release_model #WMOICE
0337: set_actor 2@ visibility 0
04C4: create_coordinate 24@ 25@ 26@ from_actor $PLAYER_ACTOR offset  0.3  0.7 0.0
068D: 16@ 17@ 18@//get_camera_position
0087: 18@ = 16@  // floating-point values only
0087: 19@ = 17@  // floating-point values only
0063: 18@ -= 24@  // floating-point values
0063: 19@ -= 25@  // floating-point values
0013: 18@ *=  -0.5  // floating-point values
0013: 19@ *=  -0.5  // floating-point values
005B: 16@ += 18@  // floating-point values
005B: 17@ += 19@  // floating-point values
05D3: AS_actor 2@ goto_point 16@ 17@ 26@ mode 7 500 ms // versionA
wait 1000
0337: set_actor 2@ visibility 1
05E2: AS_actor 2@ kill_actor $PLAYER_ACTOR




with this link
http://www.gtaforums...54542#_PostMark
and with this
http://www.gtaforums...54542#_PostMark
and this
http://www.gtaforums...154542#PostMark

Michael.Knight1
  • Michael.Knight1

    Knight Rider

  • BUSTED!
  • Joined: 15 Dec 2011

#370

Posted 18 March 2012 - 03:13 PM

hello people , I Thinks if You will help me wink.gif
I'am finished in my new Mod Hitman Blood Money for gta san andreas is a full version and the next is Hitman Contracts and Was left to me just hitman Weapons Spawn !!
I make it but in i select a weapons I will not find the weapons at player
that's some of my script , pleasse what is the Error here ??
allways peace
CODE

03E5: show_text_box 'AMMU_H'
Player.CanMove($PLAYER_CHAR) = False
08D4: $WP = create_panel_with_title 'WSPAWN' position 40.0 150.0 width 186.0 columns 1 interactive 1 background 1 alignment 1
08DB: set_panel $WP column 0 header 'SP' data 'SP1' 'SP2' 'SP3' 'SP4' 'SP5' 'SP6' 'SP7' 'SP8' 'SP9' 'DUMMY' 'DUMMY' 'DUMMY'
-i put the camera on actor
===================================
:HITMANWEAPONS_10
0001: wait 0 ms
00D6: if
8449:   not actor $PLAYER_ACTOR in_a_car
004D: jump_if_false @HITMANWEAPONS_700
00D6: if
$ONMISSION == 0
004D: jump_if_false @HITMANWEAPONS_500
0871: init_jump_table $WEAPONS total_jumps 7 default_jump 0 @HITMANWEAPONS_400 jumps 0 @HITMANWEAPONS_100 1 @HITMANWEAPONS_111 2 @HITMANWEAPONS_122 3 @HITMANWEAPONS_133 4 @HITMANWEAPONS_144 5 @HITMANWEAPONS_155 6 @HITMANWEAPONS_166

:HITMANWEAPONS_400
0871: init_jump_table $WEAPONS total_jumps 2 default_jump 0 @HITMANWEAPONS_100  jumps 8 @HITMANWEAPONS_177 9 @HITMANWEAPONS_188 10 @HITMANWEAPONS_100 -1 @HITMANWEAPONS_100 -1 @HITMANWEAPONS_100 -1 @HITMANWEAPONS_100 -1 @HITMANWEAPONS_100
===================================
then i jump all to hitmanweapons_500
===================================

:HITMANWEAPONS_600
I GIVE ACTOR WEAPONS [ $WEAPONS]

:HITMANWEAPONS_700
I Removethe panel and restor Camera  then i Put the player can move
0A92: create_custom_thread "Weapon-Spawn.cs"
0A93: end_custom_thread

Silent
  • Silent

    Moderating Cookie Monster

  • Feroci
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [GTA] 2013
    Most Helpful [Modding] 2013
    Most Talented [Modding] 2013
    Best Map 2013 "ViceCityStories PC Edition"
    Best Vehicle 2013 "III Aircraft"
    Most Helpful [Modding] 2012
    Modder of the Year 2012

#371

Posted 18 March 2012 - 03:41 PM

QUOTE (Michael.Knight1 @ Sunday, Mar 18 2012, 16:13)
pleasse what is the Error here ??

You.

Michael.Knight1
  • Michael.Knight1

    Knight Rider

  • BUSTED!
  • Joined: 15 Dec 2011

#372

Posted 18 March 2012 - 04:04 PM

QUOTE (SilentPL @ Sunday, Mar 18 2012, 15:41)
QUOTE (Michael.Knight1 @ Sunday, Mar 18 2012, 16:13)
pleasse what is the Error here ??

You.

You Start The War @SilentPL . . .
You are dumb , stupid and also ugly . . .
Does not take knowledge from the capital of the Stupid .
you must not kidding .
that really pissed me off man, you need to have more respect for people man, seriously, stop being such as dick about it and deal with it, learn to accept the word no, because im tired of asking you to please not use my stuff, i dont mind you using my stuff ok , you need to accept this, when someone says no it means no, dont try and argue about it ok, its just a video game, theres no reason to go all bitchy and asshole about it, sure im an ass about it too, but just because they are annoying assholes who wont listen like you are, so please try and be more respectful and maybe i might not have to be a asshole about everything, anyways im done talking about it, i still dont like you and that will not change ever, so please just credit us and drop it already, goodbye

Shrektastic
  • Shrektastic

    /pol/itician and /b/ro from 8chan

  • Members
  • Joined: 17 Oct 2010
  • Austria

#373

Posted 18 March 2012 - 06:32 PM

QUOTE (Michael.Knight1 @ Sunday, Mar 18 2012, 16:04)
QUOTE (SilentPL @ Sunday, Mar 18 2012, 15:41)
QUOTE (Michael.Knight1 @ Sunday, Mar 18 2012, 16:13)
pleasse what is the Error here ??

You.

You Start The War @SilentPL . . .
You are dumb , stupid and also ugly . . .
Does not take knowledge from the capital of the Stupid .
you must not kidding .
that really pissed me off man, you need to have more respect for people man, seriously, stop being such as dick about it and deal with it, learn to accept the word no, because im tired of asking you to please not use my stuff, i dont mind you using my stuff ok , you need to accept this, when someone says no it means no, dont try and argue about it ok, its just a video game, theres no reason to go all bitchy and asshole about it, sure im an ass about it too, but just because they are annoying assholes who wont listen like you are, so please try and be more respectful and maybe i might not have to be a asshole about everything, anyways im done talking about it, i still dont like you and that will not change ever, so please just credit us and drop it already, goodbye

@SilentPL Hahaha nice one icon14.gif

@Michael.Retard1 Why did he start the war? But even if he did, there's absolutely no need to offend him and write that he is dumb, stupid and ugly. First take a look at yourself, tough guy. You just come here, write your gibberish crap. From what I have seen, you are the troublemaker here. You write that SilentPL has no respect but again look at yourself. You are bitching around every time somebody does not understand your gibberish crap because of your crappy english skill. Instead of wasting your time with III Era Coding that you will never understand anyway, go and learn english. It's more important in life. icon14.gif

MichaelKnight1
  • MichaelKnight1

    Snitch

  • BUSTED!
  • Joined: 24 Mar 2012

#374

Posted 02 April 2012 - 12:28 PM

Zaz I Follow Your Tutorial for Memory Address , but i find problem in this address
CODE

0x969130 - Weapon Set 1
0x969131 - Weapon Set 2
0x969132 - Weapon Set 3

is not work ??
CODE

{$CLEO .cs}
thread 'MAIN'
wait 3000
:MAIN_1
0A8D: 1@ = read_memory 0x969130   size 4 virtual_protect 1
wait 100
03F0: text_draw_toggle  1
0001: wait  50 ms
03F0: text_draw_toggle  0
0001: wait  50 ms
045A: text_draw_1number  250.0  40.0 'NUMBER' 1@
0A8C: write_memory 0x969130   size 4 value 2 virtual_protect 1
0A93: end_custom_thread


also i use call scm function
CODE

0AA5: call 0x438370 _cheatEnableLegimate num_params 1 pop 1 cheat_ID 0

http://www.gtaforums...entry1060963546
everyone not work ??
When the player load a weapons Then after three seconds Leave them ! Why ??

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • None

#375

Posted 02 April 2012 - 08:58 PM

QUOTE (ZAZ @ Friday, Jun 5 2009, 21:34)
read_memory

the cleo opcodes 0A8D: and 0A8C: to read the content of memory adresses
at first we must know which adress have a function
you can find a list at: gtamodding.com
for exemple:
0x863984 - [Int32] Gravity

a simple GRAVITY script with text_draw opcodes to show the content of the adress:
CODE
{$CLEO .cs}
thread 'GRAVITY'
wait 3000
:GRAVITY_1
0A8D: 1@ = read_memory 0x863984   size 4 virtual_protect 1
wait 100
03F0: text_draw_toggle  1
0001: wait  50 ms
03F0: text_draw_toggle  0
0001: wait  50 ms
045A: text_draw_1number  250.0  40.0 'NUMBER' 1@
0A8C: write_memory 0x863984   size 4 value 2 virtual_protect 1 //clear the buffer
0A93: end_custom_thread


at the end we pushes the value 2 into the memory adress
test the script and look for result
2 seems to have the best effect but this adress is really crazy and if we push a float value the effect is different
try
CODE
0A8C: write_memory 0x863984   size 4 value 10.0 virtual_protect 1 //clear the buffer

and you will see the trees deforming

It's actually float value, not Int32.
By default GTA SA gravity is equal to 1/125 = 0.008
Why do you draw float value as it was integer then? It will look oddly.

There are few ways to draw floats, i'll show you my functions:

CODE
:DrawFloatOnScreen
{
Description:
   Draws float on screen using TCFLT or TCFLTN GXT entry.

Parameters:
  Passed:
    0@ - number (float)
    1@ - accuracy  
    2@ - screen pos X
    3@ - screen pos Y
   
  Result:
    none

Example:
 0AB1: call_scm_func @DrawFloatOnScreen 4 number 5@ accuracy 1 position 320.0 240.0
}
0AB1: call_scm_func @FloatPartsToIntegerValuesLengthSpecified 2 num 0@ after_comma_accuraccy 1 before_point_to 4@ after_point 5@

   if
   0@ < 0.0
   then
   045B: draw_text_2numbers 2@ 3@ GXT 'TCFLTN' numbers 4@ 5@
   else
   045B: draw_text_2numbers 2@ 3@ GXT 'TCFLT' numbers 4@ 5@
   end
0AB2: ret 0

:FloatPartsToIntegerValuesLengthSpecified
{
Description:
   Converts a float part before and after point to integer values

Parameters:
  Passed:
    0@ - number (float)
    1@ - precision
   
  Result:
    0@ - before point
    1@ - after point

Example:
 0AB1: call_scm_func @FloatPartsToIntegerValuesLengthSpecified 2 num 1.0 after_comma_accuraccy 4 before_point_to 1@ after_point 2@
}
0097: make 0@ absolute_float
0092: 2@ = float 0@ to_integer

0093: 3@ = integer 2@ to_float
0063: 0@ -= 3@  // (float)

   if
   1@ > 0
   then
   4@ = 10.0
       while 1@ > 1
       4@ *= 10.0    
       1@ -= 1
       end
   006B: 0@ *= 4@  // (float)    
   end

0092: 3@ = float 0@ to_integer
0093: 3@ = integer 3@ to_float
0087: 4@ = 0@ // (float)
0063: 4@ -= 3@  // (float)  

0092: 0@ = float 0@ to_integer
   if
   4@ > 0.0
   then
   0@ += 1
   end

0AB2: ret 2 2@ 0@

,
FloatPartsToIntegerValuesLengthSpecified gives you two parts of number as integer: before comma and after comma.
You must specify the accuracy.
DrawFloatOnScreen draws it on screen using GXT entries:
CODE
TCFLT ~r~~1~.~1~
TCFLTN ~r~-~1~.~1~

justys12
  • justys12

    Player Hater

  • Members
  • Joined: 07 Dec 2009

#376

Posted 09 April 2012 - 01:44 PM

can someone tell my how to spawn added cars not replaced ?? because when i try spawn car whit id 18631 it just wont show up. confused.gif

ZAZ
  • ZAZ

    Kernlochbohrer

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

#377

Posted 09 April 2012 - 03:50 PM Edited by ZAZ, 09 April 2012 - 03:54 PM.

QUOTE (justys12 @ Monday, Apr 9 2012, 13:44)
can someone tell my how to spawn added cars not replaced ?? because when i try spawn car whit id 18631 it just wont show up. confused.gif

Try it first with origin car id. Change then the id when you saw that it worked fine.
CODE
{$CLEO .cs}
thread 'CARSPWI'

0@ = 411 // < --- model ID


while true
wait 0
   if
      Player.Defined($PLAYER_CHAR)
   then
       if
           0AB0:   key_pressed 8// ----- press BACKSPACE
       then
           04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset 0.0 5.0 0.2
           Model.Load(0@)
               while not Model.Available(0@)
               wait 0
               end
           1@ = Car.Create(0@, 11@, 12@, 13@)
           Model.Destroy(0@)
           Car.RemoveReferences(1@)
           wait 1000
       end
   end
end


Use Cleo carspawner for added cars:
Car Spawner By Fastman92 (cleo4)
AddCar spawner by ZAZ (cleo3/4)

Please don't post again here unless you have a question about the tutorial lessons


justys12
  • justys12

    Player Hater

  • Members
  • Joined: 07 Dec 2009

#378

Posted 09 April 2012 - 03:58 PM

QUOTE (ZAZ @ Monday, Apr 9 2012, 15:50)
QUOTE (justys12 @ Monday, Apr 9 2012, 13:44)
can someone tell my how to spawn added cars not replaced ?? because when i try spawn car whit id 18631 it just wont show up. confused.gif

Try it first with origin car id. Change then the id when you saw that it worked fine.
CODE
{$CLEO .cs}
thread 'CARSPWI'

0@ = 411 // < --- model ID


while true
wait 0
   if
      Player.Defined($PLAYER_CHAR)
   then
       if
           0AB0:   key_pressed 8// ----- press BACKSPACE
       then
           04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset 0.0 5.0 0.2
           Model.Load(0@)
               while not Model.Available(0@)
               wait 0
               end
           1@ = Car.Create(0@, 11@, 12@, 13@)
           Model.Destroy(0@)
           Car.RemoveReferences(1@)
           wait 1000
       end
   end
end


Use Cleo carspawner for added cars:
Car Spawner By Fastman92 (cleo4)
AddCar spawner by ZAZ (cleo3/4)

Please don't post again here unless you have a question about the tutorial lessons

but can i make that car spawn in some location like in grove street? not whit key pressing. i using this code
CODE

014B: $PARKED_1 = init_parked_car_generator #AUDITT color 1 1 1 alarm 0 door_lock 0 0 10000 at 2552.3 -1692.5 9.2797 angle 0.0
014C: set_parked_car_generator $PARKED_1 cars_to_generate_to 101

but only cars whit id 612 and 613 spawning

ZAZ
  • ZAZ

    Kernlochbohrer

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

#379

Posted 09 April 2012 - 06:13 PM Edited by ZAZ, 01 May 2012 - 10:50 PM.

No

justys12
  • justys12

    Player Hater

  • Members
  • Joined: 07 Dec 2009

#380

Posted 09 April 2012 - 07:12 PM

QUOTE (ZAZ @ Monday, Apr 9 2012, 18:13)
No

ok thx for help

BEASTXxWOLF
  • BEASTXxWOLF

    AlcatrazIV

  • Members
  • Joined: 22 Mar 2011

#381

Posted 16 April 2012 - 02:12 PM

Is it possible to attach searchlight to the end of a gun instead of hand?

MichaelKnight1
  • MichaelKnight1

    Snitch

  • BUSTED!
  • Joined: 24 Mar 2012

#382

Posted 16 April 2012 - 08:45 PM

Hello Zaz sarcasm.gif , I want to know What is The Hex ??
and How To do it , anyways peace

Ash_735
  • Ash_735

    1 627 826 3789

  • BUSTED!
  • Joined: 15 Nov 2005
  • None
  • Most Knowledgeable [GTA] 2013
    Best Map 2013 "ViceCityStories PC Edition"

#383

Posted 16 April 2012 - 08:55 PM

QUOTE (MichaelKnight1 @ Monday, Apr 16 2012, 20:45)
Hello Zaz sarcasm.gif , I want to know What is The Hex ??
and How To do it , anyways peace

...How do you function?

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • None

#384

Posted 16 April 2012 - 10:21 PM

QUOTE (justys12 @ Monday, Apr 9 2012, 16:58)
QUOTE (ZAZ @ Monday, Apr 9 2012, 15:50)
QUOTE (justys12 @ Monday, Apr 9 2012, 13:44)
can someone tell my how to spawn added cars not replaced ?? because when i try spawn car whit id 18631 it just wont show up. confused.gif

Try it first with origin car id. Change then the id when you saw that it worked fine.
CODE
{$CLEO .cs}
thread 'CARSPWI'

0@ = 411 // < --- model ID


while true
wait 0
   if
      Player.Defined($PLAYER_CHAR)
   then
       if
           0AB0:   key_pressed 8// ----- press BACKSPACE
       then
           04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset 0.0 5.0 0.2
           Model.Load(0@)
               while not Model.Available(0@)
               wait 0
               end
           1@ = Car.Create(0@, 11@, 12@, 13@)
           Model.Destroy(0@)
           Car.RemoveReferences(1@)
           wait 1000
       end
   end
end


Use Cleo carspawner for added cars:
Car Spawner By Fastman92 (cleo4)
AddCar spawner by ZAZ (cleo3/4)

Please don't post again here unless you have a question about the tutorial lessons

but can i make that car spawn in some location like in grove street? not whit key pressing. i using this code
CODE

014B: $PARKED_1 = init_parked_car_generator #AUDITT color 1 1 1 alarm 0 door_lock 0 0 10000 at 2552.3 -1692.5 9.2797 angle 0.0
014C: set_parked_car_generator $PARKED_1 cars_to_generate_to 101

but only cars whit id 612 and 613 spawning

GTA SA exe function that registers parket generatator checks if ID of vehicle is between 400 and 630 (range intentionally reserved for vehicles). You need ro patch this function in gta_sa.exe menory.
I have no time left to to do it since i started working to understand format of Painkiller's archives. I almost finished and now i only need to decode files that are compressed with ZLib algorithm. So Painkiller modding will be on the run.

MichaelKnight1
  • MichaelKnight1

    Snitch

  • BUSTED!
  • Joined: 24 Mar 2012

#385

Posted 19 April 2012 - 12:59 PM Edited by MichaelKnight1, 19 April 2012 - 01:03 PM.

I salute all the people , I always say Peace , ok will go into the heart of the matter , in This Script While I Wanna To Active The Code Number 2 or 3 . . . Does not work . But The Code 1 is Work Is there a mistake of the Jump To Label ?? so This Pt. in my script , anyways peace icon14.gif
CODE
{$CLEO}
thread 'NEWKEYPCC'
0662: NOP "NEW KEYPRESS CHEAT CODE"
0662: NOP "CHEAT DISABLED BY FASTMA92"
0662: NOP "VERSION : 1.0"
0662: NOP "AUTHOR : MICHAEL.KNIGHT1"
0662: NOP "VISIT WWW.GTAUNITEDGANG.UCOZ.COM"

:NEWKEYPCC_157
wait 0
if
  Player.Defined($PLAYER_CHAR)
  Actor.Defined($PLAYER_ACTOR)
jf @NEWKEYPCC_157
if
  Player.Controllable($PLAYER_CHAR)
jf @NEWKEYPCC_157

:NEWKEYPCC_198
wait 0
if and
0AB0:   key_pressed 72
0AB0:   key_pressed 65
0AB0:   key_pressed 77
jf @NEWKEYPCC_198
03E6: remove_text_box
03E5: show_text_box 'C_ACTIVE'
0AA5: call 4427328 1 pop 1 3
wait 1500

:NEWKEYPCC_265
wait 0
if and
0AB0:   key_pressed 72
0AB0:   key_pressed 65
0AB0:   key_pressed 77
jf @NEWKEYPCC_265
03E6: remove_text_box
Player.Money($PLAYER_CHAR) += -250000
Actor.Armour($PLAYER_ACTOR) = -100
Actor.Health($PLAYER_ACTOR) = 10
03E5: show_text_box 'C_DEACTI'
wait 1500
jump @NEWKEYPCC_157

:NEWKEYPCC_349
wait 0
if and
0AB0:   key_pressed 87
0AB0:   key_pressed 65
0AB0:   key_pressed 78
jf @NEWKEYPCC_349
03E5: show_text_box 'C_ACTIVE'
0AA5: call 4427408 1 pop 1 4
wait 1500
jump @NEWKEYPCC_157

:NEWKEYPCC_421
wait 0
if and
0AB0:   key_pressed 67
0AB0:   key_pressed 87
0AB0:   key_pressed 76
jf @NEWKEYPCC_421
03E5: show_text_box 'C_ACTIVE'
0AA5: call 4427552 1 pop 1 5
jump @NEWKEYPCC_157

:NEWKEYPCC_488
wait 0
if and
0AB0:   key_pressed 83
0AB0:   key_pressed 87
0AB0:   key_pressed 76
jf @NEWKEYPCC_488
03E5: show_text_box 'C_ACTIVE'
0AA5: call 4427552 1 pop 1 66
jump @NEWKEYPCC_157

:NEWKEYPCC_555
wait 0
if and
0AB0:   key_pressed 83
0AB0:   key_pressed 87
jf @NEWKEYPCC_555
03E5: show_text_box 'C_ACTIVE'
0AA5: call 4427584 1 pop 1 6
jump @NEWKEYPCC_157

:NEWKEYPCC_618
wait 0
if and
0AB0:   key_pressed 86
0AB0:   key_pressed 83
0AB0:   key_pressed 87
jf @NEWKEYPCC_618
03E5: show_text_box 'C_ACTIVE'
0AA5: call 4427600 1 pop 1 7
jump @NEWKEYPCC_157

:NEWKEYPCC_685
wait 0
if and
0AB0:   key_pressed 79
0AB0:   key_pressed 67
0AB0:   key_pressed 87
jf @NEWKEYPCC_685
03E5: show_text_box 'C_ACTIVE'
0AA5: call 4427616 1 pop 1 8
jump @NEWKEYPCC_157

ZAZ
  • ZAZ

    Kernlochbohrer

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

#386

Posted 19 April 2012 - 04:49 PM

Please write the keypress names as comment behind their number
CODE
0AB0:   key_pressed 72//  h key


Bind your checks like a chain like in this Teleport lesson
study how i extended the simple script to a larger one

MichaelKnight1
  • MichaelKnight1

    Snitch

  • BUSTED!
  • Joined: 24 Mar 2012

#387

Posted 19 April 2012 - 06:14 PM

QUOTE (ZAZ @ Thursday, Apr 19 2012, 16:49)
Please write the keypress names as comment behind their number
CODE
0AB0:   key_pressed 72//  h key


Bind your checks like a chain like in this Teleport lesson
study how i extended the simple script to a larger one

Thanks Zaz is Work , I Will Continued For My Work ++ icon14.gif

PangTongNinja
  • PangTongNinja

    Can I Pikachu?

  • Members
  • Joined: 09 Apr 2012

#388

Posted 24 April 2012 - 03:39 AM

I want to teleport inside a building like...the hospital near G-street how do i get there?

ZAZ
  • ZAZ

    Kernlochbohrer

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

#389

Posted 24 April 2012 - 04:48 AM

QUOTE (PangTongNinja @ Tuesday, Apr 24 2012, 03:39)
I want to teleport inside a building like...the hospital near G-street how do i get there?

read Teleport lesson

SA-Modding
  • SA-Modding

    Grand Theft Auto Fan

  • BUSTED!
  • Joined: 29 Feb 2012

#390

Posted 26 April 2012 - 03:23 PM Edited by SA-Modding, 26 April 2012 - 05:04 PM.





This Post Have Been Sloved For personal reasons




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users