Quantcast

Jump to content

» «
Photo

how to spawn ped in random location using cleo script ?

6 replies to this topic
GtaHellmodded
  • GtaHellmodded

    Coding

  • Members
  • Joined: 05 Jul 2013
  • None

#1

Posted 24 August 2014 - 06:30 AM Edited by GtaHellmodded, 24 August 2014 - 06:32 AM.

i have a question about how to create a ped attack CJ and any ped near him but he must spawn in random location , please help me  :panic:


Cell Tennyson
  • Cell Tennyson

    Co Con Co CONN!!

  • Members
  • Joined: 22 Oct 2012
  • India

#2

Posted 24 August 2014 - 07:50 AM Edited by Cell Tennyson, 24 August 2014 - 08:06 AM.

I hope you know the basics of scripting.

Ok First you need to get the coordinates of the place where you want to spawn the ped. (you can use sanny builder's IDE tools> Coords manager)
Second You will have to request and load the Model you want to spawn by making a script. (this includes requesting the model and then loading it giving it health guns or anything like that)
Third Release the model.

Well thats it.
  • The Legend X likes this

GtaHellmodded
  • GtaHellmodded

    Coding

  • Members
  • Joined: 05 Jul 2013
  • None

#3

Posted 24 August 2014 - 01:07 PM

i mean it spawn in random location not my set location like random criminal on street


Cell Tennyson
  • Cell Tennyson

    Co Con Co CONN!!

  • Members
  • Joined: 22 Oct 2012
  • India

#4

Posted 24 August 2014 - 05:11 PM Edited by Cell Tennyson, 24 August 2014 - 05:16 PM.

You can use:-
0208: [email protected] = random_float_in_ranges -0.2 0.2
opcode for X Y Z axis and than give range. I think that should let you to spawn a ped in random areas..
But i may be wrong.
  • The Legend X likes this

GtaHellmodded
  • GtaHellmodded

    Coding

  • Members
  • Joined: 05 Jul 2013
  • None

#5

Posted 25 August 2014 - 12:45 AM

ok thanks ! let me try this opcode

0208: [email protected] = random_float_in_ranges -0.2 0.2

Cell Tennyson
  • Cell Tennyson

    Co Con Co CONN!!

  • Members
  • Joined: 22 Oct 2012
  • India

#6

Posted 25 August 2014 - 06:09 AM

Yes try and report me the results. :)

GtaHellmodded
  • GtaHellmodded

    Coding

  • Members
  • Joined: 05 Jul 2013
  • None

#7

Posted 01 September 2014 - 09:26 AM Edited by GtaHellmodded, 01 September 2014 - 09:57 AM.

well i write cleo script using this but i can't using this opcode because i don't know how to using it  :panic:\

 

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007
{$VERSION 3.1.0027}
{$CLEO .cs}

//-------------MAIN---------------
thread 'ACTOR' 
:ACTOR_11 wait 0 
if 
Player.Defined($PLAYER_CHAR) 
else_jump @ACTOR_11 
Model.Load(#AK47) 
Model.Load(#BIKERA) 
0208: [email protected] = random_float_in_ranges -0.2 100.0 
0208: [email protected] = random_float_in_ranges -0.2 100.0 
0208: [email protected] = random_float_in_ranges -0.2 100.0 

:ACTOR_89
wait 0 
if 
Model.Available(#BIKERA) 
else_jump @ACTOR_89 

[email protected] = Actor.Create(Mission1, #BIKERA, [email protected], [email protected], [email protected]) 
Actor.Angle([email protected]) = 0.6267 
0187: [email protected] = create_marker_above_actor [email protected] 
075C: marker [email protected] enabled 
0446: set_actor [email protected] immune_to_headshots 1
060A: create_decision_maker_type 1 store_to [email protected] // decision\allowed\m_.ped files 
07E5: copy_decision_maker [email protected] to [email protected] Actor.Health([email protected]) = 200 
0946: set_actor [email protected] actions_uninterupted_by_weapon_fire 0 
0245: set_actor [email protected] walk_style_to "SWAT" 
07DD: set_actor [email protected] temper_to 100 // see pedstats.dat 
02E0: actor [email protected] aggressive
03FE: set_actor [email protected] money 0 
01B2: give_actor [email protected] weapon 30 ammo 9999 // Load the weapon model before using this 
01B9: set_actor [email protected] armed_weapon_to 30 
02E2: set_actor [email protected] weapon_accuracy_to 75
0850: AS_actor [email protected] follow_actor $PLAYER_ACTOR 
05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR 
Model.Destroy(#BIKERA) 
wait 0 
 
:ACTOR_256
wait 0 
if not 
Actor.Dead([email protected]) 
else_jump @ACTOR_319 
if
0104: actor $PLAYER_ACTOR near_actor [email protected] radius 100.0 100.0 100.0 sphere 0 
else_jump @ACTOR_319 
jump @ACTOR_256 

:ACTOR_319 
Actor.RemoveReferences([email protected]) 
0164: disable_marker [email protected] wait 4000 
jump @ACTOR_11
 
 

if you know how to correct bug please help me   :santa:





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users