Forum Jump :

Author Message

Dead3yez  

I am evil


Posts: 3113
Rank:


Level: Member

Country: en
Location: North Yorkshire
Occupation: dead3yez
Age: 27
In-game name: dead3yez

 
#16 Posted at 2010-10-28 21:54        
     
In that screenshot you're missing half of the line?

Also, I forgot something else (waitUNtil).

waitUntil {civcheck};
{
KilledUnit = _x addEventhandler ["killed", {nul = _this execVM "civkilled_x.sqf"; CivKilledVar = [_this select  0, _this select 1]; Publicvariable "CivKilledVar"};];
} forEach List trig1;



Anyway, sorry for giving such bad instructions. *SORRY*


Author Message

ogion  



Posts: 115
Rank:


Level: Member

Country: se
Location:
Occupation: Small business owner
Age: 41
In-game name: Ogion [SW]

 
#17 Posted at 2010-10-28 21:59        
     
Not really, it just got cut off, it is really there... :S
So, I'll try the new version...

"Do, or do not. There is no try!" - Yoda
http://www.silentwarriors.org.uk/

Advertisement


Author Message

ogion  



Posts: 115
Rank:


Level: Member

Country: se
Location:
Occupation: Small business owner
Age: 41
In-game name: Ogion [SW]

 
#18 Posted at 2010-10-29 22:34        
     
Sorry, no dice still! wtf is so hard with this anyways?

I mean

1. The scrip counts the number of civs on the map and remembers it.
2. In the event the civ count should drop from its initial value, the culprit is registered and punished.
3. A message going out to all players a civ was killed
4. If a predetermined number of civs are killed, the game ends.

How hard can it be???? :S

"Do, or do not. There is no try!" - Yoda
http://www.silentwarriors.org.uk/

Author Message


Posts: 13
Rank:


Level: Member

Country: 00
Location:
Occupation:
Age:
In-game name:

 
#19 Posted at 2015-05-03 12:57        
     
# Dead3yez : First off, the script shown will only work properly in Singleplayer.


Secondly, I think you will have to addMPeventhandler killed to each civilian.

If the units are placed in the editor then use this in init.sqf:
{
  if (side _x == civilian) then {
KilledUnit = _x addMPeventhandler ["killed", {nul = _this execVM "civkilled.sqf"}];
};
} forEach allUnits;

civkilled.sqf

_killer = _this select 1;
if (player == _killer) then {
	disableUserInput true;
	player setPos getPos jail;
	Hint "You are being punished for killing a civilian";
	player setDir 0;
	sleep 30;
	hint "Don't do it again!!!";
	disableUserInput false;
	player setPos getMarkerPos "in";
};

What if I want to get a killed unit name or type in the civkilled.sqf to show it in side chat? And also what's the difference between "_this" and "this"?