Jump to content
Bernt

Problem with call second car

Recommended Posts

Hello Scripters,

I have a problem with this script, this script call the nearst car on the map.

But i can only use this one time at the same point.

If i want a second car on the emergency, then must i call this one on the another side of the map...

//Version 1.2 //
//Frei verwendbar, solang diese Kommentare erhalten bleiben //
//und per PN oder E-Mail eine schriftliche Erlaubniss vorliegt //
//Version 1.0 //
//©Gerrit & Bernt van Dongen //

const char IMG_ICON[] = "A1";
const char IMG_CURSOR[] = "send";

object Alarmambu : CommandScript
{

Alarmambu()
{
SetIcon(IMG_ICON);
SetCursor(IMG_CURSOR);
SetValidTargets(ACTOR_FLOOR | ACTOR_STREET);
}

bool CheckPossible(GameObject *Caller)
{
return true;
}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
Person p(Caller);

if (!Game::IsFreeplay())
return false;

if (Caller->GetID() == Target->GetID())
return false;

return true;
}

void PushActions(GameObject *Caller, Actor *Target, int ChildID)
{
VehicleList vl_rtw1("ambu");
VehicleList vl_rtw2("ambu2");
VehicleList vl_rtw3("ambu3");

Vehicle v_rtw1 = vl_rtw1.GetVehicle(0);
Vehicle v_rtw2 = vl_rtw2.GetVehicle(0);
Vehicle v_rtw3 = vl_rtw3.GetVehicle(0);

Vector v_est = Game::GetCommandPos();

float f_est_x = v_est.x; //x, y und z der EST
float f_est_y = v_est.y;
float f_est_z = v_est.z;

float f_rtw1d = v_rtw1.Distance(f_est_x, f_est_y, f_est_z); //distanzen jeden NEFs zur EST
float f_rtw2d = v_rtw2.Distance(f_est_x, f_est_y, f_est_z);
float f_rtw3d = v_rtw3.Distance(f_est_x, f_est_y, f_est_z);

if(v_rtw1.HasCommand("ich_bin_nicht_frei")) //Wenn ich nicht frei bin bin ich gaaaanz weit weg
f_rtw1d = 99999.9;

if(v_rtw2.HasCommand("ich_bin_nicht_frei"))
f_rtw2d = 99999.9;

if(v_rtw3.HasCommand("ich_bin_nicht_frei"))
f_rtw3d = 99999.7;


if(f_rtw1d < f_rtw2d && f_rtw1d < f_rtw3d)
Game::ExecuteCommand("PCmdFPAlarmambu",Caller,Target);

if(f_rtw2d < f_rtw1d && f_rtw2d < f_rtw3d)
Game::ExecuteCommand("PCmdFPAlarmambu2",Caller,Target);

if(f_rtw3d < f_rtw1d && f_rtw3d < f_rtw2d)
Game::ExecuteCommand("PCmdFPAlarmambu3",Caller,Target);
}
};

//////////////////////////////////////////////////////////////////////////////////////////////////////////
// A-Rescue Mod - Freeplay Alarm RTW1 - Script v1.7 //
// ************************************************ //
// //
// 1.0| PCmdFPAlarmRTW1 //
// //
// _____________________ //
// Skript frei fuer alle //
//////////////////////////////////////////////////////////////////////////////////////////////////////////


const char IMG_ICON[] = "heal";
const char IMG_CURSOR[] = "send";

const char COMMANDABLE_TRUE[] = "DUMMYSetCommandableTrue";
const char COMMANDABLE_FALSE[] = "DUMMYSetCommandableFalse";

const char FREEFORALERT_TRUE[] = "DUMMYFPSetFreeForAlertTrue";
const char FREEFORALERT_FALSE[] = "DUMMYFPSetFreeForAlertFalse";
const char FREEFORALERT[] = "DUMMYFPIsFreeForAlert";

const char INBASE_TRUE[] = "DUMMYFPSetInBaseTrue";
const char INBASE_FALSE[] = "DUMMYFPSetInBaseFalse";
const char INBASE[] = "DUMMYFPIsInBase";

// 1.0
object PCmdFPAlarmambu : CommandScript
{

PCmdFPAlarmambu()
{
SetIcon(IMG_ICON);
SetCursor(IMG_CURSOR);
SetValidTargets(ACTOR_FLOOR | ACTOR_STREET);
}

bool CheckPossible(GameObject *Caller)
{
GameObjectList ol;
GameObject *o;
ol = Game::GetGameObjects("ambu");
o = *ol.GetObject(0);
Vehicle v(o);

// nicht einsatzbereit
if (!v.HasCommand(FREEFORALERT))
return false;

return true;
}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
Person p(Caller);

if (!Game::IsFreeplay())
return false;

if (p.HasName("LeitstellePerson"))
return true;

if (Caller->GetID() == Target->GetID())
return false;

return false;
}

void PushActions(GameObject *Caller, Actor *Target, int childID)
{
GameObjectList ol;
GameObject *o;
ActorList al;
Actor spawnpoint;
Vector spawnpos;
Person p;
float rot[9];
float childRot[9];
Vector tpos;
PersonList pl;

// fahrzeug finden
ol = Game::GetGameObjects("ambu");

// fahrzeug anwaehlen
o = *ol.GetObject(0);
Vehicle v(o);

// ersatzfahrzeug?
if (v.IsDestroyed())
{
// spaeter wird hier ersatzfahrzeug gefordert
Mission::PlayHint("RTW1 wurde zerstoert und steht deshalb nicht mehr zur Verfuegung.");
return; // abbrechen
}

// frei fuer einsatz?
if (!v.HasCommand(FREEFORALERT))
{
Game::ExecuteCommand("PCmdFPAlarmambu2",Caller,Target);
return;
}
else
{
// alarm-meldung ausgeben
Mission::PlayHint("A1 Inzet 21-101");

// fahrzeug auf "im einsatz" setzen
v.PushActionExecuteCommand(ACTION_NEWLIST, FREEFORALERT_FALSE, &v, 1, true);

// wache-eingang finden
al=Game::GetActors("ambue");
if(al.GetNumActors() > 0)
{
spawnpoint = *al.GetActor(0);
spawnpos = spawnpoint.GetPosition();
}
else
{
Mission::PlayHint("Kann Rettungswache1-Eingang nicht finden!");
return;
}

// besatzung erzeugen?
bool ob_ra1 = false;
bool ob_ra2 = false;
pl = v.GetPassengers();
for(int i=0; i < pl.GetNumPersons(); i++)
{
//Mission::PlayHint(v.GetName());
if (pl.GetPerson(i)->HasCommand("PcmdStabilize"))
{
if(ob_ra1)
{
ob_ra2 = true;
//Mission::PlayHint("Test... Habe Sani 2 an Board");
}
else
{
ob_ra1 = true;
//Mission::PlayHint("Test... Habe Sani 1 an Board");
}
}
if (pl.GetPerson(i)->IsParamedicTeam())
{
ob_ra1 = true;
ob_ra2 = true;
//Mission::PlayHint("Test... Habe Sani-Team an Board");
}
}
bool vinbase = false;
if (v.HasCommand(INBASE))
{
vinbase = true;
Mission::PlayHint("Ambulance 22-201 Status 1!");
}

// Sanitaeter 1 // besatzung erzeugen (1/2)
if (!ob_ra1 && vinbase)
{
p = Game::CreatePerson("mod:Prototypes/Persons/01Ambulance/sani.e4p","Verpleeg");
p.GetRotation(rot[0], rot[1], rot[2], rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]);
Math::EulerToMatrix(0.f, 0.f, 0.f, childRot);
Math::MultiplyMatrices(childRot, rot);
p.SetRotation(childRot[0], childRot[1], childRot[2], childRot[3], childRot[4], childRot[5], childRot[6], childRot[7], childRot[8]);

// " an wache-eingang spawnen
GameObject *px(p);
Game::FindFreePosition(px, spawnpos, 100);
p.SetPosition(spawnpos);

// " set commandable false
p.PushActionExecuteCommand(ACTION_NEWLIST, COMMANDABLE_FALSE, &p, 1, true);

// " set commandable true
p.PushActionExecuteCommand(ACTION_APPEND, COMMANDABLE_TRUE, &p, 1, true);

// " in fahrzeug einsteigen
p.PushActionExecuteCommand(ACTION_APPEND, "entercar", o, 0, false);
}

// Sanitaeter 2 // besatzung erzeugen (2/2)
if (!ob_ra2 && vinbase)
{
p = Game::CreatePerson("mod:Prototypes/Persons/01Ambulance/sani.e4p","Verpleeg");
p.GetRotation(rot[0], rot[1], rot[2], rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]);
Math::EulerToMatrix(0.f, 0.f, 0.f, childRot);
Math::MultiplyMatrices(childRot, rot);
p.SetRotation(childRot[0], childRot[1], childRot[2], childRot[3], childRot[4], childRot[5], childRot[6], childRot[7], childRot[8]);

// " an wache-eingang spawnen
GameObject *px(p);
Game::FindFreePosition(px, spawnpos, 100);
p.SetPosition(spawnpos);

// " set commandable false
p.PushActionExecuteCommand(ACTION_NEWLIST, COMMANDABLE_FALSE, &p, 1, true);

// " set commandable true
p.PushActionExecuteCommand(ACTION_APPEND, COMMANDABLE_TRUE, &p, 1, true);

// " in fahrzeug einsteigen
p.PushActionExecuteCommand(ACTION_APPEND, "entercar", o, 0, false);
}
//
// besatzung einsatzbereit?
bool ready = false;
if (ob_ra1 && ob_ra2)
{
ready= true;
}

// in basis
if (vinbase)
{
v.PushActionWait(ACTION_APPEND, 4.0); //Zeit bevor Tor aufgeht
v.PushActionExecuteCommand(ACTION_APPEND, "OpenGate", &v, 1, true);
v.PushActionWait(ACTION_APPEND, 3.0); //Zeit bis Fahrzeug fŠhrt nachdem das Tor offen ist
//Mission::PlayHint(v.GetName());
}

// nicht in basis und nicht einsatzbereit?
if (!ready && !vinbase))
{
Mission::PlayHint(v.GetName());
Mission::PlayHint("Ohne zwei Sani. oder einem Sani.-Team, Einsatz nicht moeglich!");
v.PushActionExecuteCommand(ACTION_APPEND, "VCmdFPGoHome", &v, 1, true);
return;
}

// fahrzeug set commandable true
v.PushActionExecuteCommand(ACTION_APPEND, COMMANDABLE_TRUE, &v, 1, true);

// bl und sosi an
if(!v.HasCommand("DUMMYHasSiren"))
{
v.PushActionExecuteCommand(ACTION_APPEND, "VCmdSiren", o, 0, false);
}

// verlaesst basis
v.PushActionExecuteCommand(ACTION_APPEND, INBASE_FALSE, &v, 1, true);

if (!vinbase)
{
// warnleuchten aus
v.PushActionExecuteCommand(ACTION_APPEND, "VCmdWarningLightsOff", &v, 1, true);
// sl aus (beleuchtung)
v.PushActionExecuteCommand(ACTION_APPEND, "VCmdSpecialLightsOff", &v, 1, true);
}

// losfahren zum einsatzort
tpos = Game::GetCommandPos();
v.PushActionMove(ACTION_APPEND, tpos);

}
}
};

// 1.0
object PCmdFPAlarmambu2 : CommandScript
{

PCmdFPAlarmambu2()
{
SetIcon(IMG_ICON);
SetCursor(IMG_CURSOR);
SetValidTargets(ACTOR_FLOOR | ACTOR_STREET);
}

bool CheckPossible(GameObject *Caller)
{
GameObjectList ol;
GameObject *o;
ol = Game::GetGameObjects("ambu2");
o = *ol.GetObject(0);
Vehicle v(o);

// nicht einsatzbereit
if (!v.HasCommand(FREEFORALERT))
return false;

return true;
}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
Person p(Caller);

if (!Game::IsFreeplay())
return false;

if (p.HasName("LeitstellePerson"))
return true;

if (Caller->GetID() == Target->GetID())
return false;

return false;
}

void PushActions(GameObject *Caller, Actor *Target, int childID)
{
GameObjectList ol;
GameObject *o;
ActorList al;
Actor spawnpoint;
Vector spawnpos;
Person p;
float rot[9];
float childRot[9];
Vector tpos;
PersonList pl;

// fahrzeug finden
ol = Game::GetGameObjects("ambu2");

// fahrzeug anwaehlen
o = *ol.GetObject(0);
Vehicle v(o);

// ersatzfahrzeug?
if (v.IsDestroyed())
{
// spaeter wird hier ersatzfahrzeug gefordert
Mission::PlayHint("RTW1 wurde zerstoert und steht deshalb nicht mehr zur Verfuegung.");
return; // abbrechen
}

// frei fuer einsatz?
if (!v.HasCommand(FREEFORALERT))
{
Game::ExecuteCommand("PCmdFPAlarmambu3",Caller,Target);
return;
}
else
{
// alarm-meldung ausgeben
Mission::PlayHint("A1 inzet 21-106");

// fahrzeug auf "im einsatz" setzen
v.PushActionExecuteCommand(ACTION_NEWLIST, FREEFORALERT_FALSE, &v, 1, true);

// wache-eingang finden
al=Game::GetActors("ambue");
if(al.GetNumActors() > 0)
{
spawnpoint = *al.GetActor(0);
spawnpos = spawnpoint.GetPosition();
}
else
{
Mission::PlayHint("Kann Rettungswache1-Eingang nicht finden!");
return;
}

// besatzung erzeugen?
bool ob_ra1 = false;
bool ob_ra2 = false;
pl = v.GetPassengers();
for(int i=0; i < pl.GetNumPersons(); i++)
{
//Mission::PlayHint(v.GetName());
if (pl.GetPerson(i)->HasCommand("PcmdStabilize"))
{
if(ob_ra1)
{
ob_ra2 = true;
//Mission::PlayHint("Test... Habe Sani 2 an Board");
}
else
{
ob_ra1 = true;
//Mission::PlayHint("Test... Habe Sani 1 an Board");
}
}
if (pl.GetPerson(i)->IsParamedicTeam())
{
ob_ra1 = true;
ob_ra2 = true;
//Mission::PlayHint("Test... Habe Sani-Team an Board");
}
}
bool vinbase = false;
if (v.HasCommand(INBASE))
{
vinbase = true;
//Mission::PlayHint("Test... Fahrzeug ist auf seinem Stellplatz");
}

// Sanitaeter 1 // besatzung erzeugen (1/2)
if (!ob_ra1 && vinbase)
{
p = Game::CreatePerson("mod:Prototypes/Persons/01Ambulance/sani.e4p","Verpleeg");
p.GetRotation(rot[0], rot[1], rot[2], rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]);
Math::EulerToMatrix(0.f, 0.f, 0.f, childRot);
Math::MultiplyMatrices(childRot, rot);
p.SetRotation(childRot[0], childRot[1], childRot[2], childRot[3], childRot[4], childRot[5], childRot[6], childRot[7], childRot[8]);

// " an wache-eingang spawnen
GameObject *px(p);
Game::FindFreePosition(px, spawnpos, 100);
p.SetPosition(spawnpos);

// " set commandable false
p.PushActionExecuteCommand(ACTION_NEWLIST, COMMANDABLE_FALSE, &p, 1, true);

// " set commandable true
p.PushActionExecuteCommand(ACTION_APPEND, COMMANDABLE_TRUE, &p, 1, true);

// " in fahrzeug einsteigen
p.PushActionExecuteCommand(ACTION_APPEND, "entercar", o, 0, false);
}

// Sanitaeter 2 // besatzung erzeugen (2/2)
if (!ob_ra2 && vinbase)
{
p = Game::CreatePerson("mod:Prototypes/Persons/01Ambulance/sani.e4p","Verpleeg");
p.GetRotation(rot[0], rot[1], rot[2], rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]);
Math::EulerToMatrix(0.f, 0.f, 0.f, childRot);
Math::MultiplyMatrices(childRot, rot);
p.SetRotation(childRot[0], childRot[1], childRot[2], childRot[3], childRot[4], childRot[5], childRot[6], childRot[7], childRot[8]);

// " an wache-eingang spawnen
GameObject *px(p);
Game::FindFreePosition(px, spawnpos, 100);
p.SetPosition(spawnpos);

// " set commandable false
p.PushActionExecuteCommand(ACTION_NEWLIST, COMMANDABLE_FALSE, &p, 1, true);

// " set commandable true
p.PushActionExecuteCommand(ACTION_APPEND, COMMANDABLE_TRUE, &p, 1, true);

// " in fahrzeug einsteigen
p.PushActionExecuteCommand(ACTION_APPEND, "entercar", o, 0, false);
}
//
// besatzung einsatzbereit?
bool ready = false;
if (ob_ra1 && ob_ra2)
{
ready= true;
}

// in basis
if (vinbase)
{
v.PushActionWait(ACTION_APPEND, 4.0); //Zeit bevor Tor aufgeht
v.PushActionExecuteCommand(ACTION_APPEND, "OpenGate", &v, 1, true);
v.PushActionWait(ACTION_APPEND, 3.0); //Zeit bis Fahrzeug fŠhrt nachdem das Tor offen ist
//Mission::PlayHint(v.GetName());
}

// nicht in basis und nicht einsatzbereit?
if (!ready && !vinbase))
{
Mission::PlayHint(v.GetName());
Mission::PlayHint("Ohne zwei Sani. oder einem Sani.-Team, Einsatz nicht moeglich!");
v.PushActionExecuteCommand(ACTION_APPEND, "VCmdFPGoHome", &v, 1, true);
return;
}

// fahrzeug set commandable true
v.PushActionExecuteCommand(ACTION_APPEND, COMMANDABLE_TRUE, &v, 1, true);

// bl und sosi an
if(!v.HasCommand("DUMMYHasSiren"))
{
v.PushActionExecuteCommand(ACTION_APPEND, "VCmdSiren", o, 0, false);
}

// verlaesst basis
v.PushActionExecuteCommand(ACTION_APPEND, INBASE_FALSE, &v, 1, true);

if (!vinbase)
{
// warnleuchten aus
v.PushActionExecuteCommand(ACTION_APPEND, "VCmdWarningLightsOff", &v, 1, true);
// sl aus (beleuchtung)
v.PushActionExecuteCommand(ACTION_APPEND, "VCmdSpecialLightsOff", &v, 1, true);
}

// losfahren zum einsatzort
tpos = Game::GetCommandPos();
v.PushActionMove(ACTION_APPEND, tpos);

}
}
};

// 1.0
object PCmdFPAlarmambu3 : CommandScript
{

PCmdFPAlarmambu3()
{
SetIcon(IMG_ICON);
SetCursor(IMG_CURSOR);
SetValidTargets(ACTOR_FLOOR | ACTOR_STREET);
}

bool CheckPossible(GameObject *Caller)
{
GameObjectList ol;
GameObject *o;
ol = Game::GetGameObjects("ambu3");
o = *ol.GetObject(0);
Vehicle v(o);

// nicht einsatzbereit
if (!v.HasCommand(FREEFORALERT))
return false;

return true;
}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
Person p(Caller);

if (!Game::IsFreeplay())
return false;

if (p.HasName("LeitstellePerson"))
return true;

if (Caller->GetID() == Target->GetID())
return false;

return false;
}

void PushActions(GameObject *Caller, Actor *Target, int childID)
{
GameObjectList ol;
GameObject *o;
ActorList al;
Actor spawnpoint;
Vector spawnpos;
Person p;
float rot[9];
float childRot[9];
Vector tpos;
PersonList pl;

// fahrzeug finden
ol = Game::GetGameObjects("ambu3");

// fahrzeug anwaehlen
o = *ol.GetObject(0);
Vehicle v(o);

// ersatzfahrzeug?
if (v.IsDestroyed())
{
// spaeter wird hier ersatzfahrzeug gefordert
Mission::PlayHint("RTW1 wurde zerstoert und steht deshalb nicht mehr zur Verfuegung.");
return; // abbrechen
}

// frei fuer einsatz?
if (!v.HasCommand(FREEFORALERT))
{
Game::ExecuteCommand("PCmdFPAlarmambu5",Caller,Target);
return;
}
else
{
// alarm-meldung ausgeben
Mission::PlayHint("A1 inzet 21-107");

// fahrzeug auf "im einsatz" setzen
v.PushActionExecuteCommand(ACTION_NEWLIST, FREEFORALERT_FALSE, &v, 1, true);

// wache-eingang finden
al=Game::GetActors("ambue");
if(al.GetNumActors() > 0)
{
spawnpoint = *al.GetActor(0);
spawnpos = spawnpoint.GetPosition();
}
else
{
Mission::PlayHint("Kann Rettungswache1-Eingang nicht finden!");
return;
}

// besatzung erzeugen?
bool ob_ra1 = false;
bool ob_ra2 = false;
pl = v.GetPassengers();
for(int i=0; i < pl.GetNumPersons(); i++)
{
//Mission::PlayHint(v.GetName());
if (pl.GetPerson(i)->HasCommand("PcmdStabilize"))
{
if(ob_ra1)
{
ob_ra2 = true;
//Mission::PlayHint("Test... Habe Sani 2 an Board");
}
else
{
ob_ra1 = true;
//Mission::PlayHint("Test... Habe Sani 1 an Board");
}
}
if (pl.GetPerson(i)->IsParamedicTeam())
{
ob_ra1 = true;
ob_ra2 = true;
//Mission::PlayHint("Test... Habe Sani-Team an Board");
}
}
bool vinbase = false;
if (v.HasCommand(INBASE))
{
vinbase = true;
//Mission::PlayHint("Test... Fahrzeug ist auf seinem Stellplatz");
}

// Sanitaeter 1 // besatzung erzeugen (1/2)
if (!ob_ra1 && vinbase)
{
p = Game::CreatePerson("mod:Prototypes/Persons/01Ambulance/sani.e4p","Verpleeg");
p.GetRotation(rot[0], rot[1], rot[2], rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]);
Math::EulerToMatrix(0.f, 0.f, 0.f, childRot);
Math::MultiplyMatrices(childRot, rot);
p.SetRotation(childRot[0], childRot[1], childRot[2], childRot[3], childRot[4], childRot[5], childRot[6], childRot[7], childRot[8]);

// " an wache-eingang spawnen
GameObject *px(p);
Game::FindFreePosition(px, spawnpos, 100);
p.SetPosition(spawnpos);

// " set commandable false
p.PushActionExecuteCommand(ACTION_NEWLIST, COMMANDABLE_FALSE, &p, 1, true);

// " set commandable true
p.PushActionExecuteCommand(ACTION_APPEND, COMMANDABLE_TRUE, &p, 1, true);

// " in fahrzeug einsteigen
p.PushActionExecuteCommand(ACTION_APPEND, "entercar", o, 0, false);
}

// Sanitaeter 2 // besatzung erzeugen (2/2)
if (!ob_ra2 && vinbase)
{
p = Game::CreatePerson("mod:Prototypes/Persons/01Ambulance/sani.e4p","Verpleeg");
p.GetRotation(rot[0], rot[1], rot[2], rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]);
Math::EulerToMatrix(0.f, 0.f, 0.f, childRot);
Math::MultiplyMatrices(childRot, rot);
p.SetRotation(childRot[0], childRot[1], childRot[2], childRot[3], childRot[4], childRot[5], childRot[6], childRot[7], childRot[8]);

// " an wache-eingang spawnen
GameObject *px(p);
Game::FindFreePosition(px, spawnpos, 100);
p.SetPosition(spawnpos);

// " set commandable false
p.PushActionExecuteCommand(ACTION_NEWLIST, COMMANDABLE_FALSE, &p, 1, true);

// " set commandable true
p.PushActionExecuteCommand(ACTION_APPEND, COMMANDABLE_TRUE, &p, 1, true);

// " in fahrzeug einsteigen
p.PushActionExecuteCommand(ACTION_APPEND, "entercar", o, 0, false);
}
//
// besatzung einsatzbereit?
bool ready = false;
if (ob_ra1 && ob_ra2)
{
ready= true;
}

// in basis
if (vinbase)
{
v.PushActionWait(ACTION_APPEND, 4.0); //Zeit bevor Tor aufgeht
v.PushActionExecuteCommand(ACTION_APPEND, "OpenGate", &v, 1, true);
v.PushActionWait(ACTION_APPEND, 3.0); //Zeit bis Fahrzeug fŠhrt nachdem das Tor offen ist
//Mission::PlayHint(v.GetName());
}

// nicht in basis und nicht einsatzbereit?
if (!ready && !vinbase))
{
Mission::PlayHint(v.GetName());
Mission::PlayHint("Ohne zwei Sani. oder einem Sani.-Team, Einsatz nicht moeglich!");
v.PushActionExecuteCommand(ACTION_APPEND, "VCmdFPGoHome", &v, 1, true);
return;
}

// fahrzeug set commandable true
v.PushActionExecuteCommand(ACTION_APPEND, COMMANDABLE_TRUE, &v, 1, true);

// bl und sosi an
if(!v.HasCommand("DUMMYHasSiren"))
{
v.PushActionExecuteCommand(ACTION_APPEND, "VCmdSiren", o, 0, false);
}

// verlaesst basis
v.PushActionExecuteCommand(ACTION_APPEND, INBASE_FALSE, &v, 1, true);

if (!vinbase)
{
// warnleuchten aus
v.PushActionExecuteCommand(ACTION_APPEND, "VCmdWarningLightsOff", &v, 1, true);
// sl aus (beleuchtung)
v.PushActionExecuteCommand(ACTION_APPEND, "VCmdSpecialLightsOff", &v, 1, true);
}

// losfahren zum einsatzort
tpos = Game::GetCommandPos();
v.PushActionMove(ACTION_APPEND, tpos);

}
}
};

Thx,

Bernt

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...