Whoop Whoop
21.09.2013, 09:32
Moin,
ich habe ein kleines Problem, bei welchem ich Hilfe brauche, leider bin ich ein neuling was das Scrippting angeht.
Folgendes: Ich habe ein Script (nicht selbst geschrieben in dem der Player einer Art Level-System bekommt und bei einem Level-Aufstieg natürlich eine Belhonung (Fahrzeug).
Mein Problem ist aber, dass die Fahrzeuge auf den Standartwerten sofort spawnen wenn man ein Level aufsteigt. Ich möchte aber dass man es per Scroll-Menü es sich aussuchen kann wann, aber halt nur ein einziges mal.
hier der Teil vom Script als original:
vehicle_spawner =
{
_allUnits = allUnits;
player setVehicleInit "allUnits = [];";
processInitCommands;
clearVehicleInit player;
allUnits = _allUnits;
_dir = getdir player;
_pos = getpos player;
_pos = [(_pos select 0)+5*sin(_dir),(_pos select 1)+5*cos(_dir),0];
sporkulus = createVehicle [spawnthisshit, _pos, [], 0, "CAN_COLLIDE"];
sporkulus setVariable ["ObjectUID", "script made by Sporkulus", true];
};
level_up =
{
if ((currentMoney >= (v2)) and (currentMoney < (v3)) and (Currentlevel == 1)) then
{
Currentlevel = 2;
profileNamespace setVariable ["level", Currentlevel]; saveProfileNamespace;
_setlevel = profileNamespace getVariable ["level",0];
Currentlevel = _setlevel;spawnthisshit = "Old_bike_TK_CIV_EP1";call vehicle_spawner;
if (allow_texts) then {cutText [format["LEVEL %1 REACHED!", Currentlevel], "WHITE IN"];};
if (allow_sounds) then {playsound "Challenge_Completed";};genRewards = true;
};
Ich habe dann einen addaction-Befehl davor geschaltet und ein Spawn-Script dazu gepackt. Das Menü erscheint auch erst nach dem Level-Aufstieg, aber leider bleibt es auch dann da.
vehicle_spawner =
{
_allUnits = allUnits;
player setVehicleInit "allUnits = [];";
processInitCommands;
clearVehicleInit player;
allUnits = _allUnits;
_dir = getdir player;
_pos = getpos player;
_pos = [(_pos select 0)+5*sin(_dir),(_pos select 1)+5*cos(_dir),0];
sporkulus = createVehicle [spawnthisshit, _pos, [], 0, "CAN_COLLIDE"];
sporkulus setVariable ["ObjectUID", "script made by Sporkulus", true];
};
level_up =
{
if ((currentMoney >= (v2)) and (currentMoney < (v3)) and (Currentlevel == 1)) then
{
Currentlevel = 2;
profileNamespace setVariable ["level", Currentlevel]; saveProfileNamespace;
_setlevel = profileNamespace getVariable ["level",0];
Currentlevel = _setlevel;spawnthisshit = player addaction[("<t color=""#c70000"">" + ("Spawn Vehicle") +"</t>"),"Weg\zur\Datei.sqf","",5,false,true,"",""];call vehicle_spawner;
if (allow_texts) then {cutText [format["LEVEL %1 REACHED!", Currentlevel], "WHITE IN"];};
if (allow_sounds) then {playsound "Challenge_Completed";};genRewards = true;
};
Ich habe es schon mit der hideOnUse-Methode versucht, leider blieb die Action weiterhin erhalten (vill habe ich sie auch nicht richtig eingestellt).
Eine weitere erfolglose Aktion war eine removeaction einzüfugen
{_x removeAction spawnthisshit} forEach allUnits;
leider war das Problem hierbei, dass es die Spawn-Option direkt wieder ausgeschaltet hat =/
Hoffetnlich weiß einer von euch Rat.
Danke und MfG
ich habe ein kleines Problem, bei welchem ich Hilfe brauche, leider bin ich ein neuling was das Scrippting angeht.
Folgendes: Ich habe ein Script (nicht selbst geschrieben in dem der Player einer Art Level-System bekommt und bei einem Level-Aufstieg natürlich eine Belhonung (Fahrzeug).
Mein Problem ist aber, dass die Fahrzeuge auf den Standartwerten sofort spawnen wenn man ein Level aufsteigt. Ich möchte aber dass man es per Scroll-Menü es sich aussuchen kann wann, aber halt nur ein einziges mal.
hier der Teil vom Script als original:
vehicle_spawner =
{
_allUnits = allUnits;
player setVehicleInit "allUnits = [];";
processInitCommands;
clearVehicleInit player;
allUnits = _allUnits;
_dir = getdir player;
_pos = getpos player;
_pos = [(_pos select 0)+5*sin(_dir),(_pos select 1)+5*cos(_dir),0];
sporkulus = createVehicle [spawnthisshit, _pos, [], 0, "CAN_COLLIDE"];
sporkulus setVariable ["ObjectUID", "script made by Sporkulus", true];
};
level_up =
{
if ((currentMoney >= (v2)) and (currentMoney < (v3)) and (Currentlevel == 1)) then
{
Currentlevel = 2;
profileNamespace setVariable ["level", Currentlevel]; saveProfileNamespace;
_setlevel = profileNamespace getVariable ["level",0];
Currentlevel = _setlevel;spawnthisshit = "Old_bike_TK_CIV_EP1";call vehicle_spawner;
if (allow_texts) then {cutText [format["LEVEL %1 REACHED!", Currentlevel], "WHITE IN"];};
if (allow_sounds) then {playsound "Challenge_Completed";};genRewards = true;
};
Ich habe dann einen addaction-Befehl davor geschaltet und ein Spawn-Script dazu gepackt. Das Menü erscheint auch erst nach dem Level-Aufstieg, aber leider bleibt es auch dann da.
vehicle_spawner =
{
_allUnits = allUnits;
player setVehicleInit "allUnits = [];";
processInitCommands;
clearVehicleInit player;
allUnits = _allUnits;
_dir = getdir player;
_pos = getpos player;
_pos = [(_pos select 0)+5*sin(_dir),(_pos select 1)+5*cos(_dir),0];
sporkulus = createVehicle [spawnthisshit, _pos, [], 0, "CAN_COLLIDE"];
sporkulus setVariable ["ObjectUID", "script made by Sporkulus", true];
};
level_up =
{
if ((currentMoney >= (v2)) and (currentMoney < (v3)) and (Currentlevel == 1)) then
{
Currentlevel = 2;
profileNamespace setVariable ["level", Currentlevel]; saveProfileNamespace;
_setlevel = profileNamespace getVariable ["level",0];
Currentlevel = _setlevel;spawnthisshit = player addaction[("<t color=""#c70000"">" + ("Spawn Vehicle") +"</t>"),"Weg\zur\Datei.sqf","",5,false,true,"",""];call vehicle_spawner;
if (allow_texts) then {cutText [format["LEVEL %1 REACHED!", Currentlevel], "WHITE IN"];};
if (allow_sounds) then {playsound "Challenge_Completed";};genRewards = true;
};
Ich habe es schon mit der hideOnUse-Methode versucht, leider blieb die Action weiterhin erhalten (vill habe ich sie auch nicht richtig eingestellt).
Eine weitere erfolglose Aktion war eine removeaction einzüfugen
{_x removeAction spawnthisshit} forEach allUnits;
leider war das Problem hierbei, dass es die Spawn-Option direkt wieder ausgeschaltet hat =/
Hoffetnlich weiß einer von euch Rat.
Danke und MfG