cops Posted December 28, 2011 Report Share Posted December 28, 2011 Hi all,I tried a script but it don't work script : int DummyGroup = 20;const char STR_VObjPersonStart[] = "Paramedic63crew";const char STR_ProtoPerson[] = "mod:Prototypes/Persons/Fire Department/firefighternorm.e4p";const char STR_VehicleName[] = "Paramedic63";const char CommandIcon[] = "";const char AlarmMessage[] = "";const char AlarmSound[] = "";const int PersonCounter = 3;const int VehicleSirenID = 0;const int GameSoundID = 0;const int VehicleWaitingTime = 10.0;object DummyVehicleNotAvalible : CommandScript{ DummyVehicleNotAvalible() { SetGroupID(DummyGroup); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return false; }};// Alarmscriptobject PcmdAlarmParamedic63 : CommandScript{ PcmdAlarmParamedic63() { SetCursor(CommandIcon); SetIcon(CommandIcon); SetValidTargets(ACTOR_FLOOR); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(!Target->GetType() == ACTOR_FLOOR) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { GameObjectList l0 = Game::GetGameObjects(TYPE_VEHICLE); for(int i=0; i<l0.GetNumObjects(); i++) { ActorList PerStartList(STR_VObjPersonStart); if (PerStartList.GetNumActors() == 0) { System::Log("Alarmscript Can't find Virtual Object!"); return; } GameObject *Obj = l0.GetObject(i); Vehicle v(Obj); if(v.HasName(STR_VehicleName) && !v.HasCommand("DummyVehicleNotAvalible")) { for(int j=0; j<PersonCounter; j++) { Vector Pos = v.GetPosition(); Person p = Game::CreatePerson(STR_ProtoPerson, "Firefighternorm"); Vector pStartPos(PerStartList.GetActor(0)->GetPosition()); Game::FindFreePosition(&p, pStartPos, 100.f); p.SetPosition(pStartPos); p.PushActionMove(ACTION_NEWLIST, Pos); p.PushActionTurnTo(ACTION_APPEND, &v); p.PushActionEnterCar(ACTION_APPEND, &v); } Mission::PlayHint(Paramedic 63, please respond to your car); if(GameSoundID == 1) { Audio::PlaySample(AlarmSound); } Vector TargetPos=Game::GetCommandPos(); Game::FindFreePosition(&v, TargetPos, 90); v.PushActionWait(ACTION_NEWLIST, VehicleWaitingTime); if(VehicleSirenID == 1) { v.PushActionExecuteCommand(ACTION_APPEND, "VCmdSiren", &v, 0, false); } v.PushActionMove(ACTION_APPEND, TargetPos); v.AssignCommand("DummyVehicleNotAvalible"); } } }};does anyone see the fault? Quote Link to comment Share on other sites More sharing options...
cops Posted December 31, 2011 Author Report Share Posted December 31, 2011 anybody...? Quote Link to comment Share on other sites More sharing options...
helljumper51 Posted February 13, 2012 Report Share Posted February 13, 2012 What mod is this for? Quote Link to comment Share on other sites More sharing options...
RedHawk504 Posted February 13, 2012 Report Share Posted February 13, 2012 What is the problem than? You didnt mention that Quote Link to comment Share on other sites More sharing options...
cops Posted February 13, 2012 Author Report Share Posted February 13, 2012 hihi, it's already solved It's for the San Diego modifications Quote Link to comment Share on other sites More sharing options...