Jump to content
DWP

Hazmat FF Help - LA MOD

Recommended Posts

I'm trying to modify the ABCD firefighters and FF/EMT's so that they can change clothes back and forth. I've got a script that I modified from the pmcdChangeToMask script from the LAChangeClothes file, but when I tell the FF/EMT to change to ABCD or ABCD to change back to FF/EMT, the unit (firefighter) disappears. I'm relatively new to scripting, so I'm at a total loss. I'd like to make it so that they can only change at either the Water Tender or HAZMAT truck.

Also, I can't figure out how to make it so the ABCD firefighters can get into the tender. Any help is appreciated!

Here's what I've got:


object PcmdChangeToFF : CommandScript
{
PcmdChangeToFF()
{
SetCursor("clothes");
SetIcon("clothes");
//SetGroupID(CGROUP_GETEQUIPMENT);
SetPossibleCallers(ACTOR_PERSON);
SetValidTargets(ACTOR_VEHICLE | ACTOR_OBJECT);
SetRestrictions(RESTRICT_NOTDESTROYED | RESTRICT_NOTBURNING | RESTRICT_HASFIREAXE);
SetNeedsCarWithFlagSet(OF_HAS_FIREAXE);
}
/*bool CheckPossible(GameObject *Caller)
{
if(!Caller->IsValid() || Caller->GetType() != ACTOR_PERSON)
return false;
Person p(Caller);
if (p.IsCarryingPerson() || p.IsLinkedWithPerson() || p.GetFirehoseID()!=0 || p.IsPulling())
return false;
if (p.IsCurrentAction("EActionTreatPerson"))
return false;
if (!Game::ExistsNormalObjectWithFlagSet(OF_HAS_FIREAXE))
return false;
return true;
}*/
bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
if(!Caller->IsValid() || !Target->IsValid() || Caller->GetType() != ACTOR_PERSON)
return false;
Person p(Caller);
if(p.IsValid() && (p.IsCarryingPerson() || p.IsInDLKBasket() || p.IsLinkedWithPerson() || p.GetFirehoseID()!=0 || p.IsPulling() || p.GetEnteredCarID() != -1))
return false;
if (p.IsCurrentAction("EActionTreatPerson"))
return false;
Vehicle v(Target);
if (v.IsValid() && !v.IsDestroyed() && v.GetVehicleType() == VT_FIREFIGHTERS_RW || v.GetVehicleType() == VT_FIREFIGHTERS_GTF || v.GetVehicleType() == VT_FIREFIGHTERS_DLK || v.GetVehicleType() == VT_FIREFIGHTERS_TLF || v.GetVehicleType() == VT_FIREFIGHTERS_LPF || v.GetVehicleType() == VT_AMBULANCE_ITW || v.GetVehicleType() == VT_AMBULANCE_RTW)
{
return true;
}
return false;
}
void PushActions(GameObject *Caller, Actor *Target, int childID)
{
Caller->PushActionmove(ACTION_NEWLIST, Target, TARGET_PASSENGERDOOR);
Caller->PushActionTurnTo(ACTION_APPEND, Target);
Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_CHANGE, Target, 1, false);
}
};

object PcmdChangeToABCD : CommandScript
{
PcmdChangeToABCD()
{
SetCursor("clothes");
SetIcon("clothes");
//SetGroupID(CGROUP_GETEQUIPMENT);
SetPossibleCallers(ACTOR_PERSON);
SetValidTargets(ACTOR_VEHICLE | ACTOR_OBJECT);
SetRestrictions(RESTRICT_NOTDESTROYED | RESTRICT_NOTBURNING | RESTRICT_HASFIREAXE);
SetNeedsCarWithFlagSet(OF_HAS_FIREAXE);
}
/*bool CheckPossible(GameObject *Caller)
{
if(!Caller->IsValid() || Caller->GetType() != ACTOR_PERSON)
return false;
Person p(Caller);
if (p.IsCarryingPerson() || p.IsLinkedWithPerson() || p.GetFirehoseID()!=0 || p.IsPulling())
return false;
if (p.IsCurrentAction("EActionTreatPerson"))
return false;
if (!Game::ExistsNormalObjectWithFlagSet(OF_HAS_FIREAXE))
return false;
return true;
}*/
bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
if(!Caller->IsValid() || !Target->IsValid() || Caller->GetType() != ACTOR_PERSON)
return false;
Person p(Caller);
if(p.IsValid() && (p.IsCarryingPerson() || p.IsInDLKBasket() || p.IsLinkedWithPerson() || p.GetFirehoseID()!=0 || p.IsPulling() || p.GetEnteredCarID() != -1))
return false;
if (p.IsCurrentAction("EActionTreatPerson"))
return false;
Vehicle v(Target);
if (v.IsValid() && !v.IsDestroyed() && v.GetVehicleType() == VT_FIREFIGHTERS_TLF || v.GetVehicleType() == VT_FIREFIGHTERS_DeKon-P)
{
return true;
}
return false;
}
void PushActions(GameObject *Caller, Actor *Target, int childID)
{
Caller->PushActionmove(ACTION_NEWLIST, Target, TARGET_PASSENGERDOOR);
Caller->PushActionTurnTo(ACTION_APPEND, Target);
Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_CHANGE, Target, 5, false);
}
};
object PcmdChangeToMask : CommandScript
{
PcmdChangeToMask()
{
SetCursor("clothes");
SetIcon("clothes");
//SetGroupID(CGROUP_GETEQUIPMENT);
SetPossibleCallers(ACTOR_PERSON);
SetValidTargets(ACTOR_VEHICLE | ACTOR_OBJECT);
SetRestrictions(RESTRICT_NOTDESTROYED | RESTRICT_NOTBURNING | RESTRICT_HASFIREAXE);
SetNeedsCarWithFlagSet(OF_HAS_FIREAXE);
}
/*bool CheckPossible(GameObject *Caller)
{
if(!Caller->IsValid() || Caller->GetType() != ACTOR_PERSON)
return false;
Person p(Caller);
if (p.IsCarryingPerson() || p.IsLinkedWithPerson() || p.GetFirehoseID()!=0 || p.IsPulling())
return false;
if (p.IsCurrentAction("EActionTreatPerson"))
return false;
if (!Game::ExistsNormalObjectWithFlagSet(OF_HAS_FIREAXE))
return false;
return true;
}*/
bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
if(!Caller->IsValid() || !Target->IsValid() || Caller->GetType() != ACTOR_PERSON)
return false;
Person p(Caller);
if(p.IsValid() && (p.IsCarryingPerson() || p.IsInDLKBasket() || p.IsLinkedWithPerson() || p.GetFirehoseID()!=0 || p.IsPulling() || p.GetEnteredCarID() != -1))
return false;
if (p.IsCurrentAction("EActionTreatPerson"))
return false;
Vehicle v(Target);
if (v.IsValid() && !v.IsDestroyed() && v.GetVehicleType() == VT_FIREFIGHTERS_RW || v.GetVehicleType() == VT_FIREFIGHTERS_GTF || v.GetVehicleType() == VT_FIREFIGHTERS_DLK || v.GetVehicleType() == VT_FIREFIGHTERS_TLF || v.GetVehicleType() == VT_FIREFIGHTERS_LPF || v.GetVehicleType() == VT_AMBULANCE_ITW || v.GetVehicleType() == VT_AMBULANCE_RTW)
{
return true;
}
return false;
}
void PushActions(GameObject *Caller, Actor *Target, int childID)
{
Caller->PushActionmove(ACTION_NEWLIST, Target, TARGET_PASSENGERDOOR);
Caller->PushActionTurnTo(ACTION_APPEND, Target);
Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_CHANGE, Target, 2, false);
}
};

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...