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


Author Topic: How to spawn a weapon to the freeroam ped?  (Read 7444 times)

0 Members and 1 Guest are viewing this topic.

Offline Unknownsoldier

  • Hero Member
  • ****
  • Posts: 2,773
    • View Profile
Re: How to spawn a weapon to the freeroam ped?
« Reply #15 on: July 15, 2015, 10:18:06 PM »
There are 2 ways I was thinking about, and PROBABLY the 2nd one would work better. So here we go.

Code: [Select]
  for i = 1,1000000 do
    if PedGetModelID(i) == modelID then
  PedSetWeapon(i, weapID, ammo)
end
  end

The second method is editing the pedstats.dat. I do not know how to edit their values via LUA, other than only overriding 1 ped's stat.

Offline Phap

  • Full Member
  • ***
  • Posts: 216
  • Gender: Male
    • View Profile
Re: How to spawn a weapon to the freeroam ped?
« Reply #16 on: August 01, 2015, 08:05:50 PM »
There are 2 ways I was thinking about, and PROBABLY the 2nd one would work better. So here we go.

Code: [Select]
  for i = 1,1000000 do
    if PedGetModelID(i) == modelID then
  PedSetWeapon(i, weapID, ammo)
end
  end

The second method is editing the pedstats.dat. I do not know how to edit their values via LUA, other than only overriding 1 ped's stat.
Yo, wanna explain this further? :)