Hey Leute habe aktuell das Problem, das man wenn man wiederbelebt wird mit der Spawnkleidung wieder aufwacht und das Gear weg ist.
Im Rpt ist nicht auffälliges zu finden.
Code
#include "..\..\script_macros.hpp"
/*
File: fn_revived.sqf
Author: Bryan "Tonic" Boardwine
Description:
THANK YOU JESUS I WAS SAVED!
*/
private ["_medic","_dir","_reviveCost"];
_medic = param [0,"Unknown Medic",[""]];
_reviveCost = LIFE_SETTINGS(getNumber,"revive_fee");
//Damage nach Wiederbelebung
player setDamage 0.7;
life_corpse setVariable ["realname",nil,true]; //Should correct the double name sinking into the ground.
[life_corpse] remoteExecCall ["life_fnc_corpse",RANY];
_dir = getDir life_corpse;
hint format [localize "STR_Medic_RevivePay",_medic,[_reviveCost] call life_fnc_numberText];
closeDialog 0;
life_deathCamera cameraEffect ["TERMINATE","BACK"];
camDestroy life_deathCamera;
//Take fee for services.
if (BANK > _reviveCost) then {
BANK = BANK - _reviveCost;
} else {
BANK = 0;
};
//Bring me back to life.
player setDir _dir;
player setPosASL (visiblePositionASL life_corpse);
life_corpse setVariable ["Revive",nil,true];
life_corpse setVariable ["name",nil,true];
[life_corpse] remoteExecCall ["life_fnc_corpse",RANY];
deleteVehicle life_corpse;
_fnc_ACE3_setRevivedDamage = {
[player, 0.5, "head", "stab"] call ace_medical_fnc_addDamageToUnit;
uiSleep 0.1;
[player, 0.75, "hand_r", "stab"] call ace_medical_fnc_addDamageToUnit;
uiSleep 0.1;
[player, 0.75, "hand_l", "stab"] call ace_medical_fnc_addDamageToUnit;
uiSleep 0.1;
[player, 0.65, "Body", "stab"] call ace_medical_fnc_addDamageToUnit;
uiSleep 0.1;
[player, 0.85, "leg_l", "stab"] call ace_medical_fnc_addDamageToUnit;
uiSleep 0.1;
[player, 0.85, "leg_r", "stab"] call ace_medical_fnc_addDamageToUnit;
uiSleep 0.1;
[player, 0.80, "Torso", "stab"] call ace_medical_fnc_addDamageToUnit;
uiSleep 0.1;
};
life_action_inUse = false;
life_is_alive = true;
[life_save_gear] spawn life_fnc_loadDeadGear;
[] call life_fnc_playerSkins;
[] call life_fnc_hudUpdate; //Request update of hud.
[] call SOCK_fnc_updateRequest;
Alles anzeigen
Code
#include "..\..\script_macros.hpp"
/*
File: fn_revivePlayer.sqf
Author: Bryan "Tonic" Boardwine
Description:
Starts the revive process on the player.
*/
private ["_target","_revivable","_targetName","_ui","_progressBar","_titleText","_cP","_title","_reviveCost"];
_target = param [0,objNull,[objNull]];
if (isNull _target) exitWith {};
_reviveCost = LIFE_SETTINGS(getNumber,"revive_fee");
_revivable = _target getVariable ["Revive",false];
if (_revivable) exitWith {};
if (_target getVariable ["Reviving",objNull] == player) exitWith {hint localize "STR_Medic_AlreadyReviving";};
if (player distance _target > 5) exitWith {}; //Not close enough.
//Fetch their name so we can shout it.
_targetName = _target getVariable ["name","Unknown"];
_title = format [localize "STR_Medic_Progress",_targetName];
life_action_inUse = true; //Lockout the controls.
_target setVariable ["Reviving",player,true];
//Setup our progress bar
disableSerialization;
"progressBar" cutRsc ["life_progress","PLAIN"];
_ui = uiNamespace getVariable ["life_progress",displayNull];
_progressBar = _ui displayCtrl 38201;
_titleText = _ui displayCtrl 38202;
_titleText ctrlSetText format ["%2 (1%1)...","%",_title];
_progressBar progressSetPosition 0.01;
_cP = 0.01;
//Lets reuse the same thing!
for "_i" from 0 to 1 step 0 do {
if (animationState player != "AinvPknlMstpSnonWnonDnon_medic_1") then {
[player,"AinvPknlMstpSnonWnonDnon_medic_1"] remoteExecCall ["life_fnc_animSync",RCLIENT];
player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";
};
uiSleep .15;
_cP = _cP + .01;
_progressBar progressSetPosition _cP;
_titleText ctrlSetText format ["%3 (%1%2)...",round(_cP * 100),"%",_title];
if (_cP >= 1 || !alive player) exitWith {};
if (life_istazed) exitWith {}; //Tazed
if (life_isknocked) exitWith {}; //Knocked
if (life_interrupted) exitWith {};
if (player getVariable ["restrained",false]) exitWith {};
if (player distance _target > 4) exitWith {_badDistance = true;};
if (_target getVariable ["Revive",false]) exitWith {};
if (_target getVariable ["Reviving",objNull] != player) exitWith {};
};
//Kill the UI display and check for various states
"progressBar" cutText ["","PLAIN"];
player playActionNow "stop";
if (_target getVariable ["Reviving",objNull] != player) exitWith {hint localize "STR_Medic_AlreadyReviving"; life_action_inUse = false;};
_target setVariable ["Reviving",NIL,true];
if (!alive player || life_istazed || life_isknocked) exitWith {life_action_inUse = false;};
if (_target getVariable ["Revive",false]) exitWith {hint localize "STR_Medic_RevivedRespawned"; life_action_inUse = false;};
if (player getVariable ["restrained",false]) exitWith {life_action_inUse = false;};
if (!isNil "_badDistance") exitWith {titleText[localize "STR_Medic_TooFar","PLAIN"]; life_action_inUse = false;};
if (life_interrupted) exitWith {life_interrupted = false; titleText[localize "STR_NOTF_ActionCancel","PLAIN"]; life_action_inUse = false;};
life_action_inUse = false;
_target setVariable ["Revive",true,true];
[profileName] remoteExecCall ["life_fnc_revived",_target];
if (playerSide isEqualTo independent) then {
titleText[format [localize "STR_Medic_RevivePayReceive",_targetName,[_reviveCost] call life_fnc_numberText],"PLAIN"];
BANK = BANK + _reviveCost;
[1] call SOCK_fnc_updatePartial;
};
sleep .6;
player reveal _target;
Alles anzeigen
Code
#include "..\..\script_macros.hpp"
/*
File: fn_onPlayerKilled.sqf
Author: Bryan "Tonic" Boardwine
Description:
When the player dies collect various information about that player
and pull up the death dialog / camera functionality.
*/
params [
["_unit",objNull,[objNull]],
["_killer",objNull,[objNull]]
];
disableSerialization;
if !((vehicle _unit) isEqualTo _unit) then {
UnAssignVehicle _unit;
_unit action ["getOut", vehicle _unit];
_unit setPosATL [(getPosATL _unit select 0) + 3, (getPosATL _unit select 1) + 1, 0];
};
//Barrieren
[] call lala_fnc_placeableRemoveAll;
//Set some vars
_unit setVariable ["Revive",true,true];
_unit setVariable ["name",profileName,true]; //Set my name so they can say my name.
_unit setVariable ["restrained",false,true];
_unit setVariable ["Escorting",false,true];
_unit setVariable ["transporting",false,true];
_unit setVariable ["playerSurrender",false,true];
_unit setVariable ["steam64id",(getPlayerUID player),true]; //Set the UID.
if (dialog) then {
closeDialog 0;
};
//Setup our camera view
life_deathCamera = "CAMERA" camCreate (getPosATL _unit);
showCinemaBorder true;
life_deathCamera cameraEffect ["Internal","Back"];
createDialog "DeathScreen";
life_deathCamera camSetTarget _unit;
life_deathCamera camSetRelPos [0,3.5,4.5];
life_deathCamera camSetFOV .5;
life_deathCamera camSetFocus [50,0];
life_deathCamera camCommit 0;
(findDisplay 7300) displaySetEventHandler ["KeyDown","if ((_this select 1) isEqualTo 1) then {true}"]; //Block the ESC menu
//Create a thread for something?
_unit spawn {
private ["_maxTime","_RespawnBtn","_Timer"];
disableSerialization;
_RespawnBtn = ((findDisplay 7300) displayCtrl 7302);
_Timer = ((findDisplay 7300) displayCtrl 7301);
if (LIFE_SETTINGS(getNumber,"respawn_timer") < 5) then {
_maxTime = time + 5;
} else {
_maxTime = time + LIFE_SETTINGS(getNumber,"respawn_timer");
};
_RespawnBtn ctrlEnable false;
waitUntil {_Timer ctrlSetText format [localize "STR_Medic_Respawn",[(_maxTime - time),"MM:SS"] call BIS_fnc_secondsToString];
round(_maxTime - time) <= 0 || isNull _this};
_RespawnBtn ctrlEnable true;
_Timer ctrlSetText localize "STR_Medic_Respawn_2";
};
_unit spawn {
private ["_requestBtn","_requestTime"];
disableSerialization;
_requestBtn = ((findDisplay 7300) displayCtrl 7303);
_requestBtn ctrlEnable false;
_requestTime = time + 5;
waitUntil {round(_requestTime - time) <= 0 || isNull _this};
_requestBtn ctrlEnable true;
};
0 spawn life_fnc_deathScreen;
//Create a thread to follow with some what precision view of the corpse.
[_unit] spawn {
private ["_unit"];
_unit = _this select 0;
waitUntil {if (speed _unit isEqualTo 0) exitWith {true}; life_deathCamera camSetTarget _unit; life_deathCamera camSetRelPos [0,3.5,4.5]; life_deathCamera camCommit 0;};
};
//Make the killer wanted
/*if (!isNull _killer && {!(_killer isEqualTo _unit)} && {!(side _killer isEqualTo west)} && {alive _killer}) then {
if (vehicle _killer isKindOf "LandVehicle") then {
if (life_HC_isActive) then {
[getPlayerUID _killer,_killer getVariable ["realname",name _killer],"187V"] remoteExecCall ["HC_fnc_wantedAdd",HC_Life];
} else {
[getPlayerUID _killer,_killer getVariable ["realname",name _killer],"187V"] remoteExecCall ["life_fnc_wantedAdd",RSERV];
};
//Get rid of this if you don't want automatic vehicle license removal.
if (!local _killer) then {
[2] remoteExecCall ["life_fnc_removeLicenses",_killer];
};
} else {
if (life_HC_isActive) then {
[getPlayerUID _killer,_killer getVariable ["realname",name _killer],"187"] remoteExecCall ["HC_fnc_wantedAdd",HC_Life];
} else {
[getPlayerUID _killer,_killer getVariable ["realname",name _killer],"187"] remoteExecCall ["life_fnc_wantedAdd",RSERV];
};
if (!local _killer) then {
[3] remoteExecCall ["life_fnc_removeLicenses",_killer];
};
};
};
*/
life_save_gear = [player] call life_fnc_fetchDeadGear;
//speicher das eq in der DB!
[getPlayerUID player, life_save_gear] remoteExec ["life_fnc_setEquipmentDeath", 2, false];
if (LIFE_SETTINGS(getNumber,"drop_weapons_onDeath") isEqualTo 0) then {
_unit removeWeapon (primaryWeapon _unit);
_unit removeWeapon (handgunWeapon _unit);
_unit removeWeapon (secondaryWeapon _unit);
};
//Killed by cop stuff...
if (side _killer isEqualTo west && !(playerSide isEqualTo west)) then {
life_copRecieve = _killer;
//Did I rob the federal reserve?
if (!life_use_atm && {CASH > 0}) then {
//[format [localize "STR_Cop_RobberDead",[CASH] call life_fnc_numberText]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
CASH = 0;
};
};
life_fms_info = _unit getVariable["fms_status",[]];
if (!isNull _killer && {!(_killer isEqualTo _unit)}) then {
life_removeWanted = true;
};
[_unit] call life_fnc_dropItems;
life_action_inUse = false;
life_hunger = 100;
life_thirst = 100;
life_carryWeight = 0;
CASH = 0;
// life_is_alive = false;
call life_fnc_hudUpdate; //Get our HUD updated.
// [player,life_settings_enableSidechannel,playerSide] remoteExecCall ["TON_fnc_manageSC",RSERV];
[0] call SOCK_fnc_updatePartial;
[3] call SOCK_fnc_updatePartial;
[4] call SOCK_fnc_updatePartial;
Alles anzeigen
Code
#include "..\..\script_macros.hpp"
/*
File: fn_loadDeadGear.sqf
Author: Bryan "Tonic" Boardwine
Description:
BLAH
*/
private ["_allowedItems","_loadout","_primary","_launcher","_handgun","_magazines","_uniform","_vest","_backpack","_items","_primitems","_secitems","_handgunitems","_uitems","_vitems","_bitems","_handle"];
_loadout = [_this,0,[],[[]]] call BIS_fnc_param;
_primary = _loadout select 0;
_launcher = _loadout select 1;
_handgun = _loadout select 2;
_magazines = _loadout select 3;
_uniform = _loadout select 4;
_vest = _loadout select 5;
_backpack = _loadout select 6;
_items = _loadout select 7;
_primitems = _loadout select 8;
_secitems = _loadout select 9;
_handgunitems = _loadout select 10;
_uitems = _loadout select 11;
_vitems = _loadout select 12;
_bitems = _loadout select 13;
_headgear = _loadout select 14;
_goggles = _loadout select 15;
//Strip the unit down
RemoveAllWeapons player;
{player removeMagazine _x;} forEach (magazines player);
removeUniform player;
removeVest player;
removeBackpack player;
removeGoggles player;
removeHeadGear player;
{
player unassignItem _x;
player removeItem _x;
} forEach (assignedItems player);
//Add the gear
if (!(_uniform isEqualTo "")) then {_handle = [_uniform,true,false,false,false] spawn life_fnc_handleItem; waitUntil {scriptDone _handle};};
if (!(_vest isEqualTo "")) then {_handle = [_vest,true,false,false,false] spawn life_fnc_handleItem; waitUntil {scriptDone _handle};};
if (!(_backpack isEqualTo "")) then {_handle = [_backpack,true,false,false,false] spawn life_fnc_handleItem; waitUntil {scriptDone _handle};};
{
_handle = [_x,true,false,false,false] spawn life_fnc_handleItem;
waitUntil {scriptDone _handle};
} forEach _magazines;
if (!(_primary isEqualTo "")) then {[_primary,true,false,false,false] spawn life_fnc_handleItem;};
if (!(_launcher isEqualTo "")) then {[_launcher,true,false,false,false] spawn life_fnc_handleItem;};
if (!(_handgun isEqualTo "")) then {[_handgun,true,false,false,false] spawn life_fnc_handleItem;};
{_handle = [_x,true,false,false,false] spawn life_fnc_handleItem; waitUntil {scriptDone _handle};} forEach _items;
{[_x,true,false,false,true] call life_fnc_handleItem;} forEach (_uitems);
{[_x,true,false,false,true] call life_fnc_handleItem;} forEach (_vitems);
{[_x,true,true,false,false] call life_fnc_handleItem;} forEach (_bitems);
{[_x,true,false,true,false] call life_fnc_handleItem;} forEach (_primitems);
{[_x,true,false,true,false] call life_fnc_handleItem;} forEach (_secitems);
{[_x,true,false,true,false] call life_fnc_handleItem;} forEach (_handgunitems);
if (!(_headgear isEqualTo "")) then {player addHeadGear _headgear};
if (!(_goggles isEqualTo "")) then {player addGoggles _goggles};
Alles anzeigen
Ich hoffe mir kann jemand hier helfen, vielen lieben dank schonmal...