Jump to content
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
  • Announcements

    • randomperson139

      Signatures   03/04/2016

      Hi everyone. It appears that the update to the new forum has affected the format of the majority of signatures (adding extra spaces, changing sizes etc.). Due to this, could everyone please check their own signature, ensuring that it complies with the site rules. See the http://www.emergency-planet.com/tos.html/ or http://www.emergency-planet.com/topic/16848-acceptable-signature-sizes/ for more information.  We'll give it a few weeks to give enough time to edit signatures, after that the unnecessarily large signatures will simply be removed. Thanks for your cooperation. Regards, EMP Staff.
DAMSurvivor

Start a Controlled event (hostage situation) manually PLZ Help

Recommended Posts

On 6/27/2017 at 4:23 AM, itchboy said:

It isnt possible to 'force' an event in Em4.

 

Copenhagen Mod did it? Although I suppose it wasn't specific events.q

Share this post


Link to post
Share on other sites

Copenhagen mod uses a custom freeplay script that simulates its own events instead of using the Em4 native events. Cant compare that to the average mod.

Share this post


Link to post
Share on other sites

I pulled this straight out of Bieberfelde so 100% of the credit on this one goes to them, however if you put this script in your game and assign the command GenRD to a person, when you click the button a random EMS call happens. Essentially your game finds a random Ped and basically kills them... 

 

Again, I didn't come up with this, I just dug through what they had because I remember there being a menu where you could spawn all sorts of calls. And I'm pretty sure they wouldn't want anyone to publish this into their mod without permission/crediting at the very least. Pretty cool script though!

 

object GenRD : CommandScript//Zufälliger RD einsatz
{
	GenRD()
	{
		SetIcon("heal");
		SetRestrictions(RESTRICT_SELFEXECUTE);
	}

	bool CheckTarget(GameObject *Caller, Actor *Target, int linie)
	{
		return Caller->GetID()==Target->GetID();
	}

	void PushActions(GameObject *Caller, Actor *Target, int ChildID)
	{
		System::Log("GenRD");
		if(Mission::GetCounter("Injured Persons")<11){
			PersonList pl(ROLE_CIVILIAN);
			Person opfer;
			int oid=Math::rand()%(pl.GetNumPersons()*2/3);
			for(int i=0;i<pl.GetNumPersons()&&oid>-1;i++){
				if(!pl.GetPerson(i)->IsDead()&&!pl.GetPerson(i)->IsInjured()&&pl.GetPerson(i)->IsInsideMap()){
					if(oid==0){opfer=Person(pl.GetPerson(i));oid--;
					}else oid--;
				}
			}
			int id=-1;
			int zu=Math::rand()%6;
			switch(zu){
				case 0:
					Mission::PlayComment("ID_SUPERV_EVENT21"); 
					id=Game::ShowEvent("ID_FREEPLAY_EVENT_HEARTATTACK", opfer.GetPosition());
					break;
				case 1:
					Mission::PlayComment("ID_SUPERV_EVENT17");
					id=Game::ShowEvent("ID_FREEPLAY_EVENT_FALL", opfer.GetPosition());
					break;
				case 2:
					Mission::PlayComment("ID_SUPERV_EVENT19");
					id=Game::ShowEvent("ID_FREEPLAY_EVENT_CIRCULATORY_COLLAPSE", opfer.GetPosition());
					break;
				case 3:
					Mission::PlayComment("ID_SUPERV_EVENT20");
					id=Game::ShowEvent("ID_FREEPLAY_EVENT_FOOD_POISONING", opfer.GetPosition());
					break;
				case 4:
					Mission::PlayComment("ID_SUPERV_EVENT18");
					id=Game::ShowEvent("ID_FREEPLAY_EVENT_SHOCK", opfer.GetPosition());
					break;
				case 5:
					Mission::PlayComment("ID_SUPERV_EVENT22");
					id=Game::ShowEvent("ID_FREEPLAY_EVENT_STROKE", opfer.GetPosition());
					break;
			}
			char nam[10];snprintf(nam,10,"%i",id);
			Person on=Game::CreatePerson(opfer.GetPrototypeFileName(),nam);
			on.SetEnteredHouseID(opfer.GetEnteredHouseID());
			on.SetPosition(opfer.GetPosition());
			opfer.PushActionDeleteOwner(ACTION_NEWLIST);
			on.AssignCommand("GenRD");
			on.Injure(INJUREREASON_UNKNOWN, false);
			on.SetLife(Math::rand()%900+100);
			on.SetInjuredLifeDrain(Math::rand()%4);
		}
	}
};

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×