Hey ich suche immer noch wie ich es machen kann, dass nach dem Tod man das Geld und seine Items im Inventar behält und nichts auf den Boden droppt!
Danke im Voraus!
Mfg Pius von Team-Wings
Schön, dass du den Weg zu NodeZone.net gefunden hast! Aktuell bist du nicht angemeldet und kannst deshalb nur eingeschränkt auf unsere Community zugreifen. Um alle Funktionen freizuschalten, spannende Inhalte zu entdecken und dich aktiv einzubringen, registriere dich jetzt kostenlos oder melde dich mit deinem Account an.
Hey ich suche immer noch wie ich es machen kann, dass nach dem Tod man das Geld und seine Items im Inventar behält und nichts auf den Boden droppt!
Danke im Voraus!
Mfg Pius von Team-Wings
Es geht soweit auch, nur wenn du respawnst dann behältst du alle virtuellen items in deinem Inventar kann man das auch irgendwie fixen?
Hier mal die dropItems.sqf
/*
File: fn_dropItems.sqf
Author: Bryan "Tonic" Boardwine
Description:
Called on death, player drops any 'virtual' items they may be carrying.
*/
private["_obj","_unit","_item","_value"];
_unit = _this select 0;
{
_item = _x;
_value = missionNamespace getVariable _item;
switch(_item) do
{
case "life_inv_water":
{
if(_value > 0) then
{
_var = [_item,1] call life_fnc_varHandle;
_pos = _unit modelToWorld[0,3,0];
_pos = [_pos select 0, _pos select 1, 0];
_obj = "Land_BottlePlastic_V1_F" createVehicle _pos;
//_obj setVariable["water",_value,true];
[[_obj],"life_fnc_simDisable",nil,true] spawn life_fnc_MP;
_obj setPos _pos;
_obj setVariable["item",[_var,_value],true];
missionNamespace setVariable[_x,0];
};
};
case "life_inv_tbacon":
{
if(_value > 0) then
{
_var = [_item,1] call life_fnc_varHandle;
_pos = _unit modelToWorld[0,3,0];
_pos = [_pos select 0, _pos select 1, 0];
_obj = "Land_TacticalBacon_F" createVehicle _pos;
[[_obj],"life_fnc_simDisable",nil,true] spawn life_fnc_MP;
_obj setPos _pos;
_obj setVariable["item",[_var,_value],true];
missionNamespace setVariable[_x,0];
};
};
case "life_inv_redgull":
{
if(_value > 0) then
{
_var = [_item,1] call life_fnc_varHandle;
_pos = _unit modelToWorld[0,3,0];
_pos = [_pos select 0, _pos select 1, 0];
_obj = "Land_Can_V3_F" createVehicle _pos;
[[_obj],"life_fnc_simDisable",nil,true] spawn life_fnc_MP;
_obj setPos _pos;
_obj setVariable["item",[_var,_value],true];
missionNamespace setVariable[_x,0];
};
};
case "life_inv_fuelE":
{
if(_value > 0) then
{
_var = [_item,1] call life_fnc_varHandle;
_pos = _unit modelToWorld[0,3,0];
_pos = [_pos select 0, _pos select 1, 0];
_obj = "Land_CanisterFuel_F" createVehicle _pos;
[[_obj],"life_fnc_simDisable",nil,true] spawn life_fnc_MP;
_obj setPos _pos;
_obj setVariable["item",[_var,_value],true];
missionNamespace setVariable[_x,0];
};
};
case "life_inv_fuelF":
{
if(_value > 0) then
{
_var = [_item,1] call life_fnc_varHandle;
_pos = _unit modelToWorld[0,3,0];
_pos = [_pos select 0, _pos select 1, 0];
_obj = "Land_CanisterFuel_F" createVehicle _pos;
[[_obj],"life_fnc_simDisable",nil,true] spawn life_fnc_MP;
_obj setPos _pos;
_obj setVariable["item",[_var,_value],true];
missionNamespace setVariable[_x,0];
};
};
case "life_inv_coffee":
{
if (_value > 0) then
{
_var = [_item,1] call life_fnc_varHandle;
_pos = _unit modelToWorld[0,3,0];
_pos = [_pos select 0, _pos select 1, 0];
_obj = "Land_Can_V3_F" createVehicle _pos;
[[_obj],"life_fnc_simDisable",nil,true] spawn life_fnc_MP;
_obj setPos _pos;
_obj setVariable["item",[_var,_value],true];
missionNamespace setVariable[_x,0];
};
};
case "life_cash":
{
if(life_cash > 0) then
{
_pos = _unit modelToWorld[0,3,0];
_pos = [_pos select 0, _pos select 1, 0];
_obj = "Land_Money_F" createVehicle _pos;
_obj setVariable["item",["money",_value],true];
_obj setPos _pos;
[[_obj],"life_fnc_simDisable",nil,true] spawn life_fnc_MP;
missionNamespace setVariable[_x,0];
};
};
default
{
if(_value > 0) then
{
_var = [_item,1] call life_fnc_varHandle;
_pos = _unit modelToWorld[0,3,0];
_pos = [_pos select 0, _pos select 1, 0];
_obj = "Land_Suitcase_F" createVehicle _pos;
[[_obj],"life_fnc_simDisable",nil,true] spawn life_fnc_MP;
_obj setPos _pos;
_obj setVariable["item",[_var,_value],true];
missionNamespace setVariable[_x,0];
};
};
};
} foreach (life_inv_items + ["life_cash"]);
Alles anzeigen
Danke im Voraus!
Mfg Pius von Team-Wings
Füge das in der onKilled Datei hinzu:
{
_item = _x;
_value = missionNamespace getVariable _item;
_item - _value;
} foreach (life_inv_items);
Wo genau da?
irgendwo in der onPlayerKilled.sqf
mhhh geht immer noch nicht wenn ich respawne habe ich immer noch alle items im Z-Menü...
Hier mal meine fn_onPlayerKilled.sqf
/*
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.
*/
private["_unit","_killer","_pos","_medicsOnline"];
disableSerialization;
_unit = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
_killer = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_param;
_pos = [(getPosATL _unit select 0)-(vectorDir _unit select 0)*3,(getPosATL _unit select 1)-(vectorDir _unit select 1)*3,(getPosATL _unit select 2)+1];
//Set some vars
_unit setVariable["Revive",FALSE,TRUE]; //Set the corpse to a revivable state.
_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["steam64id",(getPlayerUID player),true]; //Set the UID.
_unit setVariable["missingOrgan",FALSE,TRUE]; //I DONT KNOW WHY SOMETIMES THEY ARE CAPS or not
_unit setVariable["hasOrgan",FALSE,TRUE];
//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 CamPreparePos _pos;
life_deathCamera camCommitPrepared 0;
life_deathCamera camSetRelPos [-3, 20, 10];
life_deathCamera camPrepareFOV 0.474;
life_deathCamera camCommit 20;
(findDisplay 7300) displaySetEventHandler ["KeyDown","if((_this select 1) == 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);
//-- NEUER CODE
_medicsOnline = {_x != player && side _x == independent} count playableUnits;
if(_medicsOnline > 0) then {
life_respawn_timer = 5; //3 Minuten, kann beliebig editiert werden!
} else {
life_respawn_timer = .1; //0,1 Minuten, auch hier kann editiert werden
};
//-- ENDE
_maxTime = time + (life_respawn_timer * 60);
_RespawnBtn ctrlEnable false;
waitUntil {_Timer ctrlSetText format["Respawn Available in: %1",[(_maxTime - time),"MM:SS.MS"] call BIS_fnc_secondsToString];
round(_maxTime - time) <= 0 || isNull _this || Life_request_timer};
if (Life_request_timer) then {
_maxTime = time + (life_respawn_timer * 120);
waitUntil {_Timer ctrlSetText format[localize "STR_Medic_Respawn",[(_maxTime - time),"MM:SS.MS"] call BIS_fnc_secondsToString];
round(_maxTime - time) <= 0 || isNull _this};
};
Life_request_timer = false; //resets increased respawn timer
_RespawnBtn ctrlEnable true;
_Timer ctrlSetText localize "STR_Medic_Respawn_2";
};
[] 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 == 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 != _unit} && {side _killer != west} && {alive _killer}) then {
if(vehicle _killer isKindOf "LandVehicle") then {
[[getPlayerUID _killer,_killer getVariable["realname",name _killer],"187V"],"life_fnc_wantedAdd",false,false] spawn life_fnc_MP;
//Get rid of this if you don't want automatic vehicle license removal.
if(!local _killer) then {
[[2],"life_fnc_removeLicenses",_killer,FALSE] spawn life_fnc_MP;
};
} else {
[[getPlayerUID _killer,_killer getVariable["realname",name _killer],"187"],"life_fnc_wantedAdd",false,false] spawn life_fnc_MP;
if(!local _killer) then {
[[3],"life_fnc_removeLicenses",_killer,FALSE] spawn life_fnc_MP;
};
};
};
//Killed by cop stuff...
if(side _killer == west && playerSide != west) then {
life_copRecieve = _killer;
//Did I rob the federal reserve?
if(!life_use_atm && {life_cash > 0}) then {
[format[localize "STR_Cop_RobberDead",[life_cash] call life_fnc_numberText],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
};
};
if(!isNull _killer && {_killer != _unit}) then {
life_removeWanted = true;
};
{
_item = _x;
_value = missionNamespace getVariable _item;
_item - _value;
} foreach (life_inv_items);
//_handle = [_unit] spawn life_fnc_dropItems;
//waitUntil {scriptDone _handle};
life_hunger = 100;
life_thirst = 100;
life_carryWeight = 0;
life_battery = 50;
life_drink = 0;
[] call life_fnc_hudUpdate; //Get our HUD updated.
[[player,life_sidechat,playerSide],"TON_fnc_managesc",false,false] spawn life_fnc_MP;
[0] call SOCK_fnc_updatePartial;
[3] call SOCK_fnc_updatePartial;
Alles anzeigen
[spoiler]# Sorry war mit Handy online Kommentar kann gelöscht werden....
Bin mit Handy online wollte es dir
Kurz richtig machen funktioniert leider nicht deswegen war der Beitrag fail^^ ich kann morgen früh das ganz schnell machen
ok danke