News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..


Author Topic: Spwaning Peds.  (Read 6317 times)

0 Members and 2 Guests are viewing this topic.

Offline DreamEvo

  • Paragon
  • Full Member
  • ***
  • Posts: 247
  • Gender: Male
    • View Profile
Spwaning Peds.
« on: June 08, 2013, 08:22:35 PM »
If i were to spawn a few greasers in the preps side of town where the basketball courts are, I know i have to get the coorandents of it but how would i spawn them there?

Offline Mick3Mouse

  • Obam3mouse
  • Bullworth Junkie
  • ****
  • Posts: 4,343
  • Gender: Male
  • Major Mick3Mouse Algie Hunter
    • View Profile
    • My youtube
Re: Spwaning Peds.
« Reply #1 on: June 09, 2013, 08:11:24 AM »
You will get the cordinates and then you will type in

Ped1 = PedCreateXYZ(23, l_1_0 + 2, l_1_1 + 2, l_1_2 + 2)

This code will spawn Johhny.

:)

Offline DreamEvo

  • Paragon
  • Full Member
  • ***
  • Posts: 247
  • Gender: Male
    • View Profile
Re: Spwaning Peds.
« Reply #2 on: June 10, 2013, 04:49:03 PM »
Thanks, is that the location of the place?

Offline Mick3Mouse

  • Obam3mouse
  • Bullworth Junkie
  • ****
  • Posts: 4,343
  • Gender: Male
  • Major Mick3Mouse Algie Hunter
    • View Profile
    • My youtube
Re: Spwaning Peds.
« Reply #3 on: June 12, 2013, 07:24:19 AM »
No

This picture shows you were you put the cordinates.



Tell me if you want more help

Offline SWEGTA

  • Da Forum Luffs Me!
  • *****
  • Posts: 6,422
  • Gender: Male
  • Swee Gee Tee Ayy
    • View Profile
    • Bully & GTA videos
Re: Spwaning Peds.
« Reply #4 on: June 12, 2013, 07:46:18 AM »
^False.
You don't need coordinates in order to spawn something.

You can simply just type in the coordinates in

Ped1 = PedCreateXYZ(23, x, y, z)
Replace x, y and z where your coords are.

Offline Mick3Mouse

  • Obam3mouse
  • Bullworth Junkie
  • ****
  • Posts: 4,343
  • Gender: Male
  • Major Mick3Mouse Algie Hunter
    • View Profile
    • My youtube
Re: Spwaning Peds.
« Reply #5 on: June 12, 2013, 09:27:53 AM »
i didnt know that. Thanks!   :)

Offline Mick3Mouse

  • Obam3mouse
  • Bullworth Junkie
  • ****
  • Posts: 4,343
  • Gender: Male
  • Major Mick3Mouse Algie Hunter
    • View Profile
    • My youtube
Re: Spwaning Peds.
« Reply #6 on: June 12, 2013, 09:28:18 AM »
But you can type up there also

deadpoolXYZ

  • Guest
Re: Spwaning Peds.
« Reply #7 on: June 12, 2013, 02:56:27 PM »
^False.
You don't need coordinates in order to spawn something.

You can simply just type in the coordinates in

Ped1 = PedCreateXYZ(23, x, y, z)
Replace x, y and z where your coords are.

Both codes are correct but using locals is cleaner.

Offline DreamEvo

  • Paragon
  • Full Member
  • ***
  • Posts: 247
  • Gender: Male
    • View Profile
Re: Spwaning Peds.
« Reply #8 on: June 12, 2013, 05:40:21 PM »
I keep on messing up on the code. Can someone help me with it? Its the basketball courts on the rich side of town.

Offline Phap

  • Full Member
  • ***
  • Posts: 216
  • Gender: Male
    • View Profile
Re: Spwaning Peds.
« Reply #9 on: June 12, 2013, 09:06:02 PM »
Which greasers you want to spawn there?

Offline Phap

  • Full Member
  • ***
  • Posts: 216
  • Gender: Male
    • View Profile
Re: Spawning Peds.
« Reply #10 on: June 12, 2013, 09:24:27 PM »
This code will spawn 4 greasers there but somehow they don't walk around or do anything, just stand there and stare :(

GlobalImportScript("SObjTest.lua")
ImportScript("Library/LibTable.lua")
ImportScript("SZone.lua")

  l_0_0 = 60

MissionSetup = function()
  local l_1_0 = 515
  local l_1_1 = 504
  local l_1_2 = 19.60971009
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)

Ped1 = PedCreateXYZ(28, 516, 504, 19.60971009)
Ped2 = PedCreateXYZ(26, 517, 504, 19.60971009)
Ped3 = PedCreateXYZ(24, 518, 504, 19.60971009)
Ped4 = PedCreateXYZ(27, 519, 504, 19.60971009)

end


F_MissionSetup = function()
  PlayerSetControl(1)
  CameraFollowPed(gPlayer)
  ClockSet(9, 30)
  ClockSetTickRate(0.0060000000521541)
  LaunchScript("SObjTest.lua")

end



MissionCleanup = function()
  ClearTextQueue()
  EnablePOI()
  gMissionRunning = false
  shared.gMissionEventFunction = nil
  WeatherRelease()
  PlayerSetControl(1)
  PlayerSetPunishmentPoints(0) 
end



main = function()
  F_MissionSetup()
  gMissionRunning = true
  while gMissionRunning do
    UpdateTextQueue()
    Wait(0)
   end
end 

Offline DreamEvo

  • Paragon
  • Full Member
  • ***
  • Posts: 247
  • Gender: Male
    • View Profile
Re: Spwaning Peds.
« Reply #11 on: June 13, 2013, 01:05:48 AM »
Thanks man and thats weird.

Offline DreamEvo

  • Paragon
  • Full Member
  • ***
  • Posts: 247
  • Gender: Male
    • View Profile
Re: Spwaning Peds.
« Reply #12 on: June 13, 2013, 05:06:45 AM »
Thanks but how come they dont show up anywhere else? Is there a way to make it so they show up every where else just like the other peds? They only stay there and only there. I would like to see them at school and town as the others.

Offline Mick3Mouse

  • Obam3mouse
  • Bullworth Junkie
  • ****
  • Posts: 4,343
  • Gender: Male
  • Major Mick3Mouse Algie Hunter
    • View Profile
    • My youtube
Re: Spwaning Peds.
« Reply #13 on: June 13, 2013, 05:57:32 AM »
You havnt typed in something to do.  The peds just stand there bucuse they have  no order to do something. 


PedAttack(gplayer, Ped1)
Will make Ped1 attack the player.

PedRecriutAlly(gplayer, Ped1)
Will make ped1 to your bodygaurd.

for example



Offline Red Blaster

  • The BB Arab
  • More Than Halfway There
  • *****
  • Posts: 5,649
  • Gender: Male
  • Hi
    • View Profile
Re: Spwaning Peds.
« Reply #14 on: June 13, 2013, 06:58:54 AM »
Quite a bit of mistakes in this section:

You havnt typed in something to do.  The peds just stand there bucuse they have  no order to do something. 


PedAttack(gplayer, Ped1)
Will make Ped1 attack the player.




You wrote the code wrong. It's actually PedAttack(Ped1, gPlayer, 0-3) Now, I know the 0-3 has something to do with aggression, but all I know is that 3 makes it so that the ped in question focuses on the ped they're attacking and ignores any attacks against him or her until they knock out the ped they're set to attack.

Thanks but how come they dont show up anywhere else? Is there a way to make it so they show up every where else just like the other peds? They only stay there and only there. I would like to see them at school and town as the others.

They stand there because they have no lua command to do something.

The thing is, these lua commands are for specific spawns. Not randomized spawning. That's done through Trigger.

This code will spawn 4 greasers there but somehow they don't walk around or do anything, just stand there and stare :(

GlobalImportScript("SObjTest.lua")
ImportScript("Library/LibTable.lua")
ImportScript("SZone.lua")

  l_0_0 = 60

MissionSetup = function()
  local l_1_0 = 515
  local l_1_1 = 504
  local l_1_2 = 19.60971009
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)

Ped1 = PedCreateXYZ(28, 516, 504, 19.60971009)
Ped2 = PedCreateXYZ(26, 517, 504, 19.60971009)
Ped3 = PedCreateXYZ(24, 518, 504, 19.60971009)
Ped4 = PedCreateXYZ(27, 519, 504, 19.60971009)

end


F_MissionSetup = function()
  PlayerSetControl(1)
  CameraFollowPed(gPlayer)
  ClockSet(9, 30)
  ClockSetTickRate(0.0060000000521541)
  LaunchScript("SObjTest.lua")

end



MissionCleanup = function()
  ClearTextQueue()
  EnablePOI()
  gMissionRunning = false
  shared.gMissionEventFunction = nil
  WeatherRelease()
  PlayerSetControl(1)
  PlayerSetPunishmentPoints(0) 
end



main = function()
  F_MissionSetup()
  gMissionRunning = true
  while gMissionRunning do
    UpdateTextQueue()
    Wait(0)
   end
end 

You forgot one thing:

Ped1 = PedCreateXYZ(28, 516, 504, 19.60971009)
Ped2 = PedCreateXYZ(26, 517, 504, 19.60971009)
Ped3 = PedCreateXYZ(24, 518, 504, 19.60971009)
Ped4 = PedCreateXYZ(27, 519, 504, 19.60971009)

Has to be like this

local Ped1 = PedCreateXYZ(28, 516, 504, 19.60971009)
local Ped2 = PedCreateXYZ(26, 517, 504, 19.60971009)
local Ped3 = PedCreateXYZ(24, 518, 504, 19.60971009)
local Ped4 = PedCreateXYZ(27, 519, 504, 19.60971009)

However, if you're writing a complex script, what you will want to do is first assign the locals in MissionSetup as follows:

local Ped1 = nil
local Ped2 = nil
local Ped3 = nil
local Ped4 = nil

and THEN write the spawn code later as follows:

Ped1 = PedCreateXYZ(28, 516, 504, 19.60971009)
Ped2 = PedCreateXYZ(26, 517, 504, 19.60971009)
Ped3 = PedCreateXYZ(24, 518, 504, 19.60971009)
Ped4 = PedCreateXYZ(27, 519, 504, 19.60971009)