IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Post mod/code requests in the Mod Requests topic

Post mod releases in the Mod Showroom

Read the Modding Rules BEFORE posting!

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


  Reply to this topicStart new topicStart Poll

 HELP! How make Peds stay in a state?

 use GTAIV .Net ScriptHook
 
fengyeblade  
Posted: Wednesday, Aug 1 2012, 06:26
Quote Post


Blade Feng Land
Group Icon
Group: Members
Joined: Feb 1, 2009

cn.gif

XXXXX



use GTAIV .Net ScriptHook

I make a ped in my group , add a task to enter vehicle.


CODE
GudList[z].Task.ClearAll();
GudList[z].Task.AlwaysKeepTask = true;
GudList[z].Task.EnterVehicle(GudCar[0], VehicleSeat.Driver);


and make he drive vehicle to a point.


CODE
if (GudList[z].isInVehicle(GudCar[0]))
GudList[z].Task.DriveTo(endpoint, sspeed, false);  


but , in game, the ped get in car, get out ,get in ,get out , get in , get out ....
he can't stay in the vehicle.
how make he stay in the car , still i give he command?
PM
  Top
 

 
Prof_Farnsworth  
Posted: Wednesday, Aug 1 2012, 15:25
Quote Post


Ambient Modder
Group Icon
Group: Members
Joined: Feb 25, 2011

XXXXX



Add another check:

CODE
GudList[z].Task.ClearAll();
GudList[z].Task.AlwaysKeepTask = true;

if (!GudList[z].isGettingInVehicle(GudCar[0])) //to make sure he is not getting in vehicle. (Notice the not(!) at the beginning of the if statement)
{
GudList[z].Task.EnterVehicle(GudCar[0], VehicleSeat.Driver);
}


Problem is the ped is getting the command to enter the vehicle while they are getting into the vehicle, which makes them get out then get in again.

Hope this helps.
PM
  Top
 

 
fengyeblade  
Posted: Thursday, Aug 2 2012, 12:26
Quote Post


Blade Feng Land
Group Icon
Group: Members
Joined: Feb 1, 2009

cn.gif

XXXXX



QUOTE (Prof_Farnsworth @ Wednesday, Aug 1 2012, 15:25)
Add another check:

CODE
GudList[z].Task.ClearAll();
GudList[z].Task.AlwaysKeepTask = true;

if (!GudList[z].isGettingInVehicle(GudCar[0])) //to make sure he is not getting in vehicle. (Notice the not(!) at the beginning of the if statement)
{
GudList[z].Task.EnterVehicle(GudCar[0], VehicleSeat.Driver);
}


Problem is the ped is getting the command to enter the vehicle while they are getting into the vehicle, which makes them get out then get in again.

Hope this helps.

thanks , i will try it. inlove.gif
PM
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG