Hallo,
Heute werde ich euch zeigen, wie ihr Organe anderen Spieler klauen könnt und diese beim Organ Dealer verkaufen könnt.
Fangen wir mal an.
1. Erstellt eine neue sqf namens fn_takeOrgans.sqf mit folgendem Inhallt:
Spoiler anzeigen
/*
file: fn_takeOrgans.sqf
author: [midgetgrimm] - A Grimm Life | Altis Life • Index page
taken from the same idea of robbing script by tonic
*/
private["_unit"];
_unit = cursorTarget;
if(isNull _unit) exitWith {}; //if unit is null, than NO
if((_unit getVariable ["missingOrgan",FALSE])) exitWith {};//must not be missing organ already
if((player getVariable ["hasOrgan",FALSE])) exitWith {};//thief must not have already robbed an organ within last 5 mintues
if((animationState _unit != "Incapacitated")) exitWith {};//victim must be knocked out
if(player == _unit) exitWith {};//if the thief is the cursor target(dafuq) than NO
if(!isPlayer _unit) exitWith {};//iff the cursor target is not a player than NO
if(life_inv_kidney >= 2) exitWith {hint "You can't possibly need that many organs!"};//if you already have 2 kidneys, then go sell them already, no stockpiling
if(!([true,"kidney",1] call life_fnc_handleInv)) exitWith {hint "You don't have room to store any organs!"};//if no room for kidney, you cannot take their kidney, duh, waste not want not
life_action_inUse = true;//sets action to true as to prevent kidney spammming!!!!!!!!
player setVariable["hasOrgan",true,true];//sets variable on thief, so as not to consistently take organs, set to 5 minute cooldown
player playMove "AinvPknlMstpSnonWnonDnon_medic";//makes the thief do an animation as to seem like they are doing surgery
sleep 3;//length of action, had weird results with any higher - obv not realistic, but whatever
_unit setVariable["missingOrgan",true,true];//sets the missing organ variable so effects can take place
life_action_inUse = false;//once variables are set, and actions stop, then you can use scrolly wheely
[[player], "life_fnc_hasOrgan", _unit, false] spawn life_fnc_MP;//this then calls the fn_hasOrgan.sqf on the thief
Und fügt die unter core\actions ein.
2. Erstellt wieder eine neue sqf namens fn_hasOrgan.sqf mit folgendem Inhallt:
Spoiler anzeigen
/*
file: fn_hasOrgan.sqf
author: [midgetgrimm] - A Grimm Life | Altis Life • Index page
*/
private["_organThief"];
_organThief = [_this,0,Objnull,[Objnull]] call BIS_fnc_param;
if(isNull _organThief) exitWith {}; //if not the thief get bent
[[1,format["%1 has cut out a kidney from %2.",name _organThief,name player]],"life_fnc_broadcast",nil,false] spawn life_fnc_MP;//lets people know you are stealing kidneys
[_organThief,"kidney",1] call life_fnc_handleInv;//put stolen kidney into inventory of thief
[[getPlayerUID _organThief,name _organThief,"919"],"life_fnc_wantedAdd",false,false] spawn life_fnc_MP;//add to wanted list
sleep 300;//no more organ theft for at least 5 minutes, so they cant just do it over and over, can do whatever time you want
_organThief setVariable["hasOrgan",false,true];//allow them to be able to take organs again- setting a variable
Und fügt die unter core\civilian ein.
3. Geht in eure functions.h und fügt bei class actions folgendes ein:
und bei class Civilian
4. Geht in eure core\fn_setupActions.sqf und fügt folgendes bei civilian ein:
// take them organs
life_actions = life_actions + [player addAction["Harvest Organs",life_fnc_takeOrgans,"",0,false,false,"",'!isNull cursorTarget && cursorTarget isKindOf "Man" && (isPlayer cursorTarget) && alive cursorTarget && cursorTarget distance player < 3.5 && !(cursorTarget getVariable ["missingOrgan",FALSE]) && !(player getVariable "Escorting") && !(player getVariable "hasOrgan") && !(player getVariable "transporting") && animationState cursorTarget == "Incapacitated"']];
5. Geht in eure core\init_survival.sqf und fügt folgendes ganz unten ein:
[] spawn {
while{true} do
{
waitUntil {(player getVariable "missingOrgan")};
life_max_health = .50;
while{(player getVariable "missingOrgan")} do {
life_thirst = 50;
life_hunger = 50;
if(damage player < (1 - life_max_health)) then {player setDamage (1 - life_max_health);};
"dynamicBlur" ppEffectEnable true;
"dynamicBlur" ppEffectAdjust [2];
"dynamicBlur" ppEffectCommit 1;
sleep 5;
};
"dynamicBlur" ppEffectEnable false;
life_max_health = 1;
};
};
Alles anzeigen
6. Geht in eure core\pmenu\fn_useItem.sqf und fügt folgendes ein:
case (_item == "kidney"):
{
if(([false,_item,1] call life_fnc_handleInv)) then
{
player setVariable["missingOrgan",false,true];
life_thirst = 100;
life_hunger = 100;
player setFatigue .5;
};
};
7. Geht in eure core\init.sqf und fügt folgendes unter den player setVariablen ein:
player setVariable["missingOrgan",false,true];//sets variables to false on start
player setVariable["hasOrgan",false,true];
Sollte ca so aussehen:
player setVariable["restrained",false,true];
player setVariable["Escorting",false,true];
player setVariable["transporting",false,true];
player setVariable["missingOrgan",false,true];
player setVariable["hasOrgan",false,true];
8. Geht in eure core/medical/fn_onPlayerKilled.sqf und fügt folgendes unter _unit ein:
9. Geht in euren core/medical/fn_onPlayerRespawn.sqf und fügt wieder unter _unit dies ein:
10. Öffnet eure core\config\fn_itemWeight.sqf und fügt folgendes ein:
11. Öffnet eure core\config\fn_varHandle.sqf und fügt folgendes ein:
case: 0
case:1
12. Geht in eure core\config\fn_varToStr.sqf und fügt folgendes ein:
13. Geht in eure core\config\fn_virt_shops.sqf und fügt einen neuen Shop hinzu mit diesem Code:
14. Geht in eure core\configuration.sqf und fügt folgendes ein:
Unter life_inv_items
Unter life_illegal_items
Unter sell_array
Unter buy_array
Als letztes müsst ihr noch in eure @life_server eine änderung vornehmen.
15. Geht in eure life_server\Functions\WantedSystem\fn_wantedAdd.sqf und fügt folgendes hinzu:
So, das war es.
Zum schluß noch einen NP erstellen mit folgendem INIT befehl:
this addAction["Organ Dealer",life_fnc_virt_menu,"organ",0,false,false,"",' vehicle player == player && player distance _target < 5 && playerSide == civilian '];
Mal kurz und knapp erklären, was das Script macht:
Ihr müsst jemmand niederhauen, und aud ihn Scrollen. Dann könnt ihr die Niere von diesem Spieler klauen. Dieser erleitet 50 Damage, und hat ein leicht verschwomenes Bild. Er muß also zum Organ Dealer gehen, und sich eine neue Niere kaufen und diese benutzen. Damit geht das leicht verschwomene Bild wieder weg. Danach könnt ihr ins Hospital gehen, und euch wieder auf 100 Heilen.
Ihr könnt euch nicht auf 100 Heilen, wenn ihr keine Niere habt. Und euch kann auch nur eine Niere geklaut werden, wenn ihr mehr wie 50 Leben habt. Habt ihr z.b. 49 Leben, kann man euch keine Niere Klauen.
Hoffe ihr habt spaß am Script.
Wenn ihr probleme habt, einfach nachfragen.
Wie versprochen, hier noch ein Tutorial das ihr nur ein Organ klauen könnt wenn ihr auch ein Scalpel bei euch habt.
1. Geht in eure core/configuration.sqf und fügt folgende sachen hinzu:
life_inv_items =
sell_array =
buy_array =
Bitte achtet überall, das euer letztes Item kein Komma haben darf.
Wenn ihr wollt, das das Scalpel Illegal ist, so fügt dies unter life_illegal_items = ein.
2. Öffnet eure core/config/fn_itemWeight.sqf und fügt folgendes hinzu:
3. Öffnet eure core/config/fn_varHandle.sqf und fügt folgendes hinzu bei case: 0
Und bei case: 1
4. Geht in eure core/config/fn_varToStr.sqf und fügt folgendes hinzu:
5. Zum schluß fügt ihr noch das Scalpel in einen Shop ein. In diesem Tut nehmen wir mal als Beispiel der Markt. Öffnet eure core/config/fn_virt_shops.sqf und fügt folgendes hinzu:
6. Öffnet eure fn_takeOrgans.sqf im actions Ordner und ersetzt alles mit diesem Text:
/*
file: fn_takeOrgans.sqf
author: [midgetgrimm] - www.grimmlife.com
taken from the same idea of robbing script by tonic
*/
private["_unit"];
_unit = cursorTarget;
if(isNull _unit) exitWith {};
if((_unit getVariable ["missingOrgan",FALSE])) exitWith {};
if((player getVariable ["hasOrgan",FALSE])) exitWith {};
if((animationState _unit != "Incapacitated")) exitWith {};
if(!([false,"scalpel",1] call life_fnc_handleInv)) exitWith {hint "Du hast kein Scalpel!"};
if(player == _unit) exitWith {};
if(!isPlayer _unit) exitWith {};
if(life_inv_kidney >= 2) exitWith {hint"Dieser Spieler hat keine Niere mehr!"};
if(!([true,"kidney",1] call life_fnc_handleInv)) exitWith {hint "Kein Platz für eine Niere."};
life_action_inUse = true;
player setVariable["hasOrgan",true,true];
player playMove "AinvPknlMstpSnonWnonDnon_medic";
[player,"punch_break"] call life_fnc_globalSound;
sleep 3;
_unit setVariable["missingOrgan",true,true];
life_action_inUse = false;
[[player], "life_fnc_hasOrgan", _unit, false] spawn life_fnc_MP;
Alles anzeigen
Nun braucht ihr ein Scalpel, um überhaupt ein Organ klauen zu können. Ein Sound habe ich ebenfalls noch eingefügt, der abgespielt wird wenn ihr mit einem Scalpel von jemmandem ein Organ klaut.
Bitte bedenkt, das die Sounddatei nur geht wenn ihr dieses Tutorial befolgt habt: [Tutorial] Sounds einfügen Global/-und Player +- 3.1.4
Wenn ihr also keinen Sound wollt, sucht in der datei nach:
und löscht es einfach.
Wenn ihr keinen Sound wollt, so Ignoriert das unten einfach
Zum schluß geht ihr noch in eure description.ext und fügt folgendes ein bei class CfgSounds:
class punch_break
{
name = "punch_break";
sound[] = {"\sounds\punch_break.ogg", 1.0, 1};
titles[] = {};
};
Ladet die Sounddatei herunter im Anhang und fügt diese in euer Ordner sounds ein.
Fertig.
MfG
Noldy