My paramedics dosn't enter car after add Trage script v1.1

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • My paramedics dosn't enter car after add Trage script v1.1

    Hi people !


    I recently installed the script "Trage v1.1" for my mod.
    My Paramedic (Sanitäter) arrives to take the stryker in RTW and even put it back in the RTW but can not be traced after the paramedics in the RTW.
    I do not know where is my mistake I'm going to put the code on this message for you to tell me if this vien script

    I want to clarify that I don't have define the emergency room because I don't have my hospital on map


    Source Code

    1. /* Tragescript v1.1 by em-modder Vielen Dank an THW Teufel für die Unterstützung*/
    2. const char PCmdGetStretcher_ICON[] = "use";const char PCmdGetRemoveStretcher_ICON[] = "use";
    3. object PCmdGetStretcher : CommandScript{ PCmdGetStretcher() { SetIcon(PCmdGetStretcher_ICON); SetCursor(PCmdGetStretcher_ICON); }
    4. bool CheckPossible(GameObject *Caller) { if(!Caller->IsValid() || Caller->GetType() != ACTOR_PERSON) return false; Person p(Caller); if(p.IsChildEnabled("stryker_normal_patient") || p.IsChildEnabled("stryker_normal")) return false; return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(!Target->IsValid() || Target->GetType() != ACTOR_VEHICLE) return false; Vehicle v(Target); if(!v.IsCommandable() && v.IsCivilCar()) return false; if(!v.HasCommand("DUMMYHasStretcher")) return false; return true; }
    5. void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID == 0){ Caller->PushActionMove(ACTION_NEWLIST, Target, TARGET_REARDOOR); Caller->PushActionTurnTo(ACTION_APPEND, Target); Caller->PushActionExecuteCommand(ACTION_APPEND, "PCmdGetStretcher", Target, 1, false); } else if(childID == 1) { Caller->SetChildEnabled("stryker_normal", true); Person p(Caller); Vehicle v(Target); p.SetUpgradeLevel(0); if(Game::IsFreeplay()){ p.SetRole(ROLE_CIVILIAN); p.SetCommandable(true); } p.RemoveCommand("PCmdGetStretcher"); p.AssignCommand("PCmdRemoveStretcher"); p.AssignCommand("Lift"); v.RemoveCommand("DUMMYHasStretcher"); v.AssignCommand("DUMMYNoStretcher"); }
    6. }};
    7. object PCmdRemoveStretcher : CommandScript{ PCmdRemoveStretcher() { SetIcon(PCmdGetRemoveStretcher_ICON); SetCursor(PCmdGetRemoveStretcher_ICON); SetPriority(600); }
    8. bool CheckPossible(GameObject *Caller) { if(!Caller->IsValid() || Caller->GetType() != ACTOR_PERSON) return false; Person p(Caller); if(p.IsChildEnabled("stryker_normal_patient")) return false; return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(!Target->IsValid() || Target->GetType() != ACTOR_VEHICLE) return false; Vehicle v(Target); if(!v.IsCommandable() && v.IsCivilCar()) return false; if(v.HasCommand("DUMMYHasStretcher") || !v.HasCommand("DUMMYNoStretcher")) return false; return true; }
    9. void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID == 0){ Caller->PushActionMove(ACTION_NEWLIST, Target, TARGET_REARDOOR); Caller->PushActionTurnTo(ACTION_APPEND, Target); Caller->PushActionExecuteCommand(ACTION_APPEND, "PCmdRemoveStretcher", Target, 1, false); } else if(childID == 1) { Caller->SetChildEnabled("stryker_normal", false); Person p(Caller); Vehicle v(Target); p.SetUpgradeLevel(3); if(Game::IsFreeplay()) p.SetRole(ROLE_SQUAD); p.RemoveCommand("PCmdRemoveStretcher"); p.AssignCommand("PCmdGetStretcher"); v.AssignCommand("DUMMYHasStretcher"); v.RemoveCommand("DUMMYNoStretcher"); }
    10. }};
    11. object DUMMYHasStretcher : CommandScript{ DUMMYHasStretcher() { SetGroupID(20); }
    12. bool CheckPossible(GameObject *Caller) { return false; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return false; }
    13. void PushActions(GameObject *Caller, Actor *Target, int childID) { }};object DUMMYNoStretcher : CommandScript{ DUMMYNoStretcher() { SetGroupID(20); } bool CheckGroupVisibility(GameObject *Caller) { return false; } bool CheckPossible(GameObject *Caller) { return false; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return false; }
    14. void PushActions(GameObject *Caller, Actor *Target, int childID) { }};
    15. object PCmdPutInCar : CommandScript{ TargetPoint targetPoint; PCmdPutInCar() { SetIcon("putintocar"); SetCursor("putintocar"); SetPriority(700); SetValidTargets(ACTOR_VEHICLE); } bool CheckPossible(GameObject *Caller) { if(!Caller->IsValid() || Caller->GetType() != ACTOR_PERSON) return false; Person p(Caller); return !p.IsLinkedWithPerson() || !p.IsCarryingPerson(); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(!Caller->IsValid() || !Target->IsValid() || Target->GetType()!=ACTOR_VEHICLE || Caller->GetType()!=ACTOR_PERSON) return false; Vehicle v(Target); if (v.GetVehicleType()==VT_NOSQUAD || v.GetFreeTransports() < 1) return false; if(!v.IsDestroyed()) { Person p(Caller); if (p.GetEnteredCarID() != -1 || p.IsContaminated()) return false; targetPoint = TARGET_REARDOOR; if(v.GetVehicleType() != VT_AMBULANCE_RTW || !p.IsChildEnabled("stryker_normal_patient")) return false; return true; }
    16. return false; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Person p(Caller); Vehicle v(Target); if(childID == 0) { Vector TargetPos = Target->GetTargetPoint(Caller, targetPoint); Caller->PushActionMove(ACTION_NEWLIST, TargetPos); Caller->PushActionTurnTo(ACTION_APPEND, Target); Caller->PushActionExecuteCommand(ACTION_APPEND, "PCmdPutInCar", Target, 1, false); } else if(childID == 1){ Actor aPerson = Game::GetActor(p.GetUserData()); if (aPerson.IsValid() && aPerson.GetType() == ACTOR_PERSON) { Caller->SetChildEnabled("stryker_normal_patient", false); Person pTransport(&aPerson); v.AddTransport(&pTransport); p.SetUpgradeLevel(3); if(Game::IsFreeplay()) p.SetRole(ROLE_SQUAD); p.RemoveCommand("PCmdRemoveStretcher"); p.AssignCommand("PCmdGetStretcher"); }else{ System::Error("PCmdPutInCar: Fehler! Person: %s, UserData: %i", p.GetName(), p.GetUserData()); } } }};
    17. object PCmdGetPatient : CommandScript{ PCmdGetPatient() { SetIcon("PCmdGetPatient_ICON"); SetCursor("PCmdGetPatient_ICON"); }
    18. bool CheckPossible(GameObject *Caller) { if(!Caller->IsValid() || Caller->GetType() != ACTOR_PERSON) return false; Person p(Caller); if(p.IsChildEnabled("stryker_normal_patient") || p.IsChildEnabled("stryker_normal")) return false; return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(!Target->IsValid() || Target->GetType() != ACTOR_VEHICLE) return false; Vehicle v(Target); if(!v.IsCommandable() && v.IsCivilCar()) return false; if(v.GetNumTransported()==0) return false; return true; }
    19. void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID == 0){ Caller->PushActionMove(ACTION_NEWLIST, Target, TARGET_REARDOOR); Caller->PushActionTurnTo(ACTION_APPEND, Target); Caller->PushActionExecuteCommand(ACTION_APPEND, "PCmdGetPatient", Target, 1, false); } else if(childID == 1 || childID == 11) { Caller->SetChildEnabled("stryker_normal_patient", true); Person p(Caller); Vehicle v(Target); p.SetUpgradeLevel(0); if(Game::IsFreeplay()){ p.SetRole(ROLE_CIVILIAN); p.SetCommandable(true); } PersonList tList = v.GetTransports(); if(tList.GetNumPersons() == 1) { Person transp(tList.GetPerson(0)); v.RemoveTransport(&transp); transp.Hide(); PersonList pList = v.GetPassengers(); p.SetUserData(transp.GetID()); } p.RemoveCommand("PCmdGetStretcher"); p.AssignCommand("PCmdPutInCar"); v.RemoveCommand("DUMMYHasStretcher"); v.AssignCommand("DUMMYNoStretcher"); if(childID == 11){ Caller->PushActionExecuteCommand(ACTION_APPEND, "PCmdGONotaufnahme", Target, 0, true); } } else if(childID == 2){ //entladen & Notaufnahme Caller->PushActionMove(ACTION_APPEND, Target, TARGET_REARDOOR); Caller->PushActionTurnTo(ACTION_APPEND, Target); Caller->PushActionExecuteCommand(ACTION_APPEND, "PCmdGetPatient", Target, 11, false); }
    20. }};
    21. object PCmdGONotaufnahme : CommandScript{ PCmdGONotaufnahme() { }
    22. bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return true; }
    23. void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID == 0){ Actor notaufnahme; Vector Pos;
    24. ActorList aList = Game::GetActors("NOTAUFNAHME"); //Name der Notaufnahme (VirtualObject) hier ändern if(aList.GetNumActors() > 0) { notaufnahme = *aList.GetActor(0); Pos = notaufnahme.GetPosition(); }else{ Game::ShowHelpTextWindow("Kann Notaufnahme nicht finden!"); return; } Caller->PushActionMove(ACTION_APPEND, Pos, true); Caller->PushActionExecuteCommand(ACTION_APPEND, "PCmdGONotaufnahme", Target, 1, false); } else if(childID == 1) { Person p(Caller); Actor aPerson = Game::GetActor(Caller->GetUserData());
    25. if (aPerson.IsValid() && aPerson.GetType() == ACTOR_PERSON) { Caller->SetChildEnabled("stryker_normal_patient", false); Caller->SetChildEnabled("stryker_normal", true); Person pTransport(&aPerson); pTransport.PushActionDeleteOwner(ACTION_APPEND); Caller->AssignCommand("PCmdGetStretcher"); Caller->AssignCommand("PCmdPutInCar"); Caller->PushActionExecuteCommand(ACTION_APPEND, "PCmdRemoveStretcher", Target, 0, true); Caller->PushActionEnterCar(ACTION_APPEND, Target); }else{ System::Error("DUMMYDeletePatient: Fehler! Person: %s, UserData: %i", Caller->GetName(), Caller->GetUserData()); } }
    26. }};
    Display All

    thanx in advance


    Ps : sorry for my very bad english, i'm french modder