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

    I will cut your soul like a SPIDER!!

  • 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

    I will cut your soul like a SPIDER!!

  • 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: 17@ = 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: 17@ = random_float_in_ranges -0.2 0.2

Cell Tennyson
  • Cell Tennyson

    I will cut your soul like a SPIDER!!

  • 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: 14@ = random_float_in_ranges -0.2 100.0 
0208: 15@ = random_float_in_ranges -0.2 100.0 
0208: 16@ = random_float_in_ranges -0.2 100.0 

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

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

:ACTOR_319 
Actor.RemoveReferences(12@) 
0164: disable_marker 22@ 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