Arminqur Posted January 12, 2014 Share Posted January 12, 2014 (edited) I know that you can make any NPC a prostitute/hooker with mods but how, can anyone please teach me. Thank you Edited January 12, 2014 by Arminqur Link to comment Share on other sites More sharing options...
LordOfTheBongs Posted January 25, 2014 Share Posted January 25, 2014 (edited) this code isnt really good for the game as it is looking at dat files to know what models to load and this keeps interfering with that, eventually it causes this script to fail and crash and most likely make gta more unstable but it does work, the best way to find the dat file that tells the game what models to spawn and where edit: for some reason when i first read your post i thought u said u wanted all NPCs to be hookers, lol, i guess u didnt want this script but it does show an example to change a ped into a hooker. U cant actually change a ped's model once it is loaded, u just have to delete them and replace them with a hooker namespace HookerTown{ using System; using GTA; public class Main : Script { private Random random; private DateTime loopStart; private double longestLoop; public Main() { random = new Random(); Tick += HookerTown_Tick; } private Model HookerModel() { return random.Next(0, 2) == 1 ? "F_Y_HOOKER_01" : "F_Y_HOOKER_03"; } private void HookerTown_Tick(object sender, EventArgs e) { loopStart = DateTime.Now; foreach (Ped ped in World.GetAllPeds()) { if (!Game.Exists(ped)) continue; if (ped == Game.LocalPlayer.Character) continue; if (ped.Model == "F_Y_HOOKER_01" || ped.Model == "F_Y_HOOKER_03") continue; Vector3 position = ped.Position.ToGround(); float heading = ped.Heading; Vehicle v = ped.CurrentVehicle; VehicleSeat seat = VehicleSeat.None; if (Game.Exists(v)) { seat = GetSeat(ped); ped.Delete(); Ped p = v.CreatePedOnSeat(seat, HookerModel()); if (Game.Exists(p)) p.isRequiredForMission = false; } else { ped.Delete(); Ped p = World.CreatePed(HookerModel(), position); if (Game.Exists(p)) { p.Heading = heading; p.isRequiredForMission = false; } } } double loopTime = (DateTime.Now - loopStart).TotalMilliseconds; longestLoop = loopTime > longestLoop ? loopTime : longestLoop; Game.DisplayText("Longest Loop: " + longestLoop.ToString() + "ms" + Environment.NewLine + "Loop Time: " + loopTime.ToString()); } private VehicleSeat GetSeat(Ped ped) { VehicleSeat[] seats = ped.CurrentVehicle.PassengerSeats == 1 ? new VehicleSeat[] { VehicleSeat.Driver, VehicleSeat.RightFront } : new VehicleSeat[] { VehicleSeat.Driver, VehicleSeat.RightFront, VehicleSeat.LeftRear, VehicleSeat.RightRear }; foreach (VehicleSeat s in seats) { if (ped.CurrentVehicle.GetPedOnSeat(s) == ped) return s; } return VehicleSeat.None; } }} Edited January 25, 2014 by LordOfTheBongs Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now