Hi,
I've been having a few problems with a mission I am making, -{SAHRANIVILLE}-, which is an RPG mission. Currently, I've had lots of help from BIS Forums, -{GOL}- clan, and numerous other individuals, and now I'm hoping you guys might be able to share some wisdom with me for my latest problem - JIP, and respawning with actions. Currently, the following script,
actions.sqf, deals with adding actions to units:
_array = [c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22];
waitUntil {alive player};
if (side player == west) then
{
{
_x addaction ["Arrest Civilian", "arrest.sqs"];
_x addaction ["Fine Civilian", "fine.sqf"];
_x addaction ["Disarm Civilian", "disarm.sqf"];
_x addAction ["Check Car Licence", "clicence.sqs"];
_x addAction ["Check Gun Licence", "glicence.sqs"];
} foreach _array;
player addaction ["Stats", "stats.sqf"];
}
else
{
player addaction ["Hands Up", "HandsUp.sqs"];
player addaction ["Stats", "stats.sqf"];
player addaction ["Dance!", "dance.sqs"];
};
This script is called from the
init.sqf by the following code:
nul=[] execVM "actions.sqf";
Now, the problem we have here is that the actions don't appear for JIP players
or those who have respawned. For the latter, a fellow project member proposed the following,
was_killed.sqf:
_unit = _this select 0;
waitUntil {PlayerRespawnTime == 0};
if (side player == west) then
{
_unit addaction ["Arrest Civilian", "arrest.sqs"];
_unit addaction ["Fine Civilian", "fine.sqf"];
_unit addaction ["Disarm Civilian", "disarm.sqf"];
_unit addAction ["Check Car Licence", "clicence.sqs"];
_unit addAction ["Check Gun Licence", "glicence.sqs"];
player addaction ["Stats", "stats.sqf"];
}
else
{
player addaction ["Hands Up", "HandsUp.sqs"];
player addaction ["Stats", "stats.sqf"];
player addaction ["Dance!", "dance.sqs"];
};
exit
... and this is called from
init.sqf with the following code:
player addEventHandler ["killed", {_this execVM "was_killed.sqf"}];
Now, the problems here are that JIP still doesn't work, nor does respawning with the actions. The worry I have is that even if
actions.sqf did work for JIP players, it would add duplicate actions to those who've already got them, if that makes sense. We did toy with the idea for JIP players of somehow recounting the array, then only applying the actions to 'null' players, since 'player' is always null when it first connects to the server.
I really hope you guys can share some wise words on this problem - I don't really want to have seperate scripts for the actions like in CrimeCity for OFP, or the original version of -{SAHRANIVILLE}-... any help is
really appreciated here chaps