Arma 3 Çetelerin Bölge Ele Geçirmesi Script

Çetelerin Bölgeyi Ele Geçirmesi

Kodları Tam Görebilmek İçin Sayfa Boyutunu %90 veya %75 Yapınız.

1.Adım core/gangs klasorunun içine yeni bir dosya açıyoruz.

Dosya Adı : fn_areaCapture.sqf

ve İçine Aşağıdaki Kodu Yapışyırıyoruz.

 [stextbox id=”alert”]

#include “..\..\script_macros.hpp”
/*
File: fn_areaCapture.sqf
Author: Rias Gremory”Berat Yıldız”
Telif Hakkı : https://www.beratyildiz.org/th/
Web Site : www.beratyildiz.org

Description:
Çete Bölgesi Ele Geçirme
*/
private[“_gangNum”,”_gName”,”_group”,”_area”,”_nil”,”_pos”,”_xname”,”_text”,”_action”,”_cpRate”,”_cP”,”_nearUnits”,”_areaContested”,”_progressBar”,”_title”,”_titleText”,”_ui”];

_area = getpos player nearestObject “Flag_Red_F”; //finds the flag
_group = _area getVariable [“gangOwner”,grpNull]; //gets the owner of the flag
_xname = “”; //setup for popo name
_nearUnits = _area nearEntities [“Man”,500]; //searches area for players
_areaContested = false; //sets the area to not contested
if ((player distance _area) > 10) exitWith { hint “You must be closer to the flag to capture this area!”; }; //too far away

/*
#########################################
# Polis Ele Geçirme Sistemi #
#########################################
*/

if (playerside isEqualTo west) exitWith {

//inform the server the police are trying to capture it.
[[0,1],”STR_GNOTF_CaptureAreaAttemptPopo”,true,[name player]] remoteExecCall [“life_fnc_broadcast”,RCLIENT];

//set the cp rate
if (!isNull _group) then {
_cpRate = 0.0045;
} else {
_cpRate = 0.0075;
};

//Police officer checks
{

//check for other members of same side
if ((isPlayer _x) && (_x != player) && (side _x == west)) then {
_areaContested = false;
};

//checks for rebels
if ((isPlayer _x) && (_x != player) && (side _x == civilian)) then {
_areaContested = true;
_xname = “Rebels”;
};

//closes the capture
if (_areaContested && _xname isEqualTo “Rebels”) then {
hint “Rebels are nearby!\nGet rid of them first!”;
};

} forEach _nearUnits;

//exit if contested
if (_areaContested) exitWith {};

//Setup our progress bar.
disableSerialization;
_title = localize “STR_GNOTF_CapturingArea”;
5 cutRsc [“life_progress”,”PLAIN”];
_ui = uiNamespace getVariable “life_progress”;
_progressBar = _ui displayCtrl 38201;
_titleText = _ui displayCtrl 38202;
_titleText ctrlSetText format[“%2 (1%1)…”,”%”,_title];
_progressBar progressSetPosition 0.01;
_cP = 0.01;

if (!(_areaContested)) then {
for “_i” from 0 to 1 step 0 do {
sleep 3; //police capture time * 100
_cP = _cP + _cpRate;
_progressBar progressSetPosition _cP;
_titleText ctrlSetText format[“%3 (%1%2)…”,round(_cP * 100),”%”,_title];

//sets the area to incapture
_area setVariable [“inCapture”,true,true];

//interuption checks
if (_cP >= 1 || !alive player) exitWith {_area setVariable [“inCapture”,false,true];};
if (player distance _area > 100) exitWith {_area setVariable [“inCapture”,false,true];}; //how far they can go from the hideout while capturing
if (_areaContested) exitWith {hint “Area Contested”;}; //Future testing
if (life_istazed) exitWith {_area setVariable [“inCapture”,false,true];}; //Tazed
if (life_isknocked) exitWith {_area setVariable [“inCapture”,false,true];}; //Knocked
if (life_interrupted) exitWith {_area setVariable [“inCapture”,false,true];}; //interupted
};
if (player distance _area > 100) exitWith {_area setVariable [“inCapture”,false,true];}; //how far they can go from the hideout while capturing
};

//Kill the UI display and check for various states
5 cutText [“”,”PLAIN”];
if (player distance _area > 100) exitWith {_area setVariable [“inCapture”,false,true];}; //how far they can go from the hideout while capturing
if (!alive player || life_istazed || life_isknocked) exitWith {life_action_inUse = false;_area setVariable [“inCapture”,false,true];}; //knocked out or tazed revert state
if (player getVariable[“restrained”,false]) exitWith {life_action_inUse = false;_area setVariable [“inCapture”,false,true];}; //restrained revert state
if (life_interrupted) exitWith {life_interrupted = false; titleText[localize “STR_GNOTF_CaptureCancel”,”PLAIN”]; life_action_inUse = false;_area setVariable [“inCapture”,false,true];}; //interupted revert state
life_action_inUse = false;
titleText[localize “STR_GNOTF_CapturedArea”,”PLAIN”];

//marker system
_gangNum = _area getVariable [“gangNum”, “”];

_gName = group player getVariable “gang_name”;
_pText = format[“Neutralized Area”];

if (_gangNum == “Gang_Area_1”) then {
“gang_cap_1” setMarkerText _pText;
};

if (_gangNum == “Gang_Area_2”) then {
“gang_cap_2” setMarkerText _pText;
};

if (_gangNum == “Gang_Area_3”) then {
“gang_cap_3” setMarkerText _pText;
};

_area setVariable [“inCapture”,false,true];
_area setVariable [“gangOwner”,group player,true];

};

/*
#############################################
# Polis Ele Geçirme Sistemi Bitiş #
#############################################
*/

/*
#########################################
# İsyancı Ele Geçirme Sistemi #
#########################################
*/

_area = getpos player nearestObject “Flag_Red_F”; //finds the flag
_group = _area getVariable [“gangOwner”,grpNull]; //gets the ownerr of the flag
_xname = “”; //setup for popo name
_nearUnits = _area nearEntities [“Man”,500]; //searches area for players
if (isNil {group player getVariable “gang_name”}) exitWith { hint “You must be in a gang to capture a gang area!”; }; //not in a gang
if (_group isEqualTo group player) exitWith { hint “Your gang already has control over this area!”; }; //already own it
if ((_area getVariable [“inCapture”,FALSE])) exitWith {hint “Only one person shall capture at once!”; }; //stops 2 people capturing at the same time

[[0,1],”STR_GNOTF_CaptureAreaAttempt”,true,[name player,(group player) getVariable “gang_name”]] remoteExecCall [“life_fnc_broadcast”,RCLIENT]; //tells the server someone is trying to capture the outpost

if (!isNull _group) then {

_gangName = _group getVariable [“gang_name”,””]; //gets the gang name

//check if they want to capture someones elses area
_action = [
format[localize “STR_GNOTF_AlreadygangControlled”,_gangName],
localize “STR_Gang_captuerr”,
localize “STR_Global_Yes”,
localize “STR_Global_No”
] call BIS_fnc_guiMessage;

_cpRate = 0.0045;
} else {
_cpRate = 0.0075;
};

//check if area is contested
{

//check for other members of same gang
if ((isPlayer _x) && (_x != player) && (side _x == civilian) && (group _x == group player)) then {
_areaContested = false;
};

//check for other rebels
if ((isPlayer _x) && (_x != player) && (side _x == civilian) && (!(group _x == group player))) then {
_areaContested = true;
};

//checks for cops
if ((isPlayer _x) && (_x != player) && (side _x == west)) then {
_areaContested = true;
_xname = “Police Force”;
};

//closes the capture
if (_areaContested) exitWith {
if (_xname isEqualTo “Police Force”) then {
hint “The Police Force are nearby!\nGet rid of them first!”;
} else {
hint “Other rebels are nearby!\nGet rid of them first!”;
};
};

} forEach _nearUnits;

//exit if contested
if (_areaContested) exitWith {};

//Setup our progress bar.
disableSerialization;
_title = localize “STR_GNOTF_CapturingArea”;
5 cutRsc [“life_progress”,”PLAIN”];
_ui = uiNamespace getVariable “life_progress”;
_progressBar = _ui displayCtrl 38201;
_titleText = _ui displayCtrl 38202;
_titleText ctrlSetText format[“%2 (1%1)…”,”%”,_title];
_progressBar progressSetPosition 0.01;
_cP = 0.01;

if (!(_areaContested)) then {
for “_i” from 0 to 1 step 0 do {
sleep 3; //rebel capture time * 100
_cP = _cP + _cpRate;
_progressBar progressSetPosition _cP;
_titleText ctrlSetText format[“%3 (%1%2)…”,round(_cP * 100),”%”,_title];

//sets the area to incapture
_area setVariable [“inCapture”,true,true];

//interuption checks
if (_cP >= 1 || !alive player) exitWith {_area setVariable [“inCapture”,false,true];};
if (player distance _area > 100) exitWith {_area setVariable [“inCapture”,false,true];}; //how far they can go from the hideout while capturing
if (_areaContested) exitWith {hint “Area Contested”;};
if (life_istazed) exitWith {_area setVariable [“inCapture”,false,true];}; //Tazed
if (life_isknocked) exitWith {_area setVariable [“inCapture”,false,true];}; //Knocked
if (life_interrupted) exitWith {_area setVariable [“inCapture”,false,true];}; //interupted
};
if (player distance _area > 100) exitWith {_area setVariable [“inCapture”,false,true];}; //how far they can go from the hideout while capturing
};

//Kill the UI display and check for various states
5 cutText [“”,”PLAIN”];
if (player distance _area > 100) exitWith {_area setVariable [“inCapture”,false,true];}; //how far they can go from the hideout while capturing
if (!alive player || life_istazed || life_isknocked) exitWith {life_action_inUse = false;_area setVariable [“inCapture”,false,true];}; //knocked out or tazed revert state
if (player getVariable[“restrained”,false]) exitWith {life_action_inUse = false;_area setVariable [“inCapture”,false,true];}; //restrained revert state
if (life_interrupted) exitWith {life_interrupted = false; titleText[localize “STR_GNOTF_CaptureCancel”,”PLAIN”]; life_action_inUse = false;_area setVariable [“inCapture”,false,true];}; //interupted revert state
life_action_inUse = false;

titleText[localize “STR_GNOTF_CapturedArea”,”PLAIN”];

//marker system
_gangNum = _area getVariable [“gangNum”, “”];

_gName = group player getVariable “gang_name”;
_Text = format[“Area Controlled By %1”,_gName];

if (_gangNum == “Gang_Area_1”) then {
“gang_cap_1” setMarkerText _text;
};

if (_gangNum == “Gang_Area_2”) then {
“gang_cap_2” setMarkerText _text;
};

if (_gangNum == “Gang_Area_3”) then {
“gang_cap_3″ setMarkerText _text;
};

//Tell the world
[[0,1],”STR_GNOTF_CaptureAreaSuccess”,true,[name player,(group player) getVariable “gang_name”]] remoteExecCall [“life_fnc_broadcast”,RCLIENT];

_area setVariable [“inCapture”,false,true];
_area setVariable [“gangOwner”,group player,true];

/*
#############################################
# İsyancı Ele Geçirme Scripti Bitiş #
#############################################
*/

[/stextbox]

 

2.Adım Functions.php Dosyasını Açıyoruz.

 [stextbox id=”alert”]class Gangs[/stextbox]

Altına Aşağıdaki Kodu Ekliyoruz.

 [stextbox id=”alert”]class areaCapture {};[/stextbox]

3.Adım Haritanızda 3 Tane Lokasyona Bölge Ekliyeceksiniz.

Lokasyon 1 için yapmanız gereken .

Bir Tane Flag_Red_F Kodlu Bir Bayrak Koyun (Kırmızı Bayrak)

Sonra bayrağın içine bu kodu yerleştirin.

 [stextbox id=”alert”]this allowDamage false; this enableSimulation false; this setVariable [“gangNum”,”Gang_Area_1″, true];[/stextbox]

Bölgeye Bi İşaret Koyun Ve İşretin kodunu gang_cap_1 yapın

Lokasyon 2 için yapmanız gereken .

Bir Tane Flag_Red_F Kodlu Bir Bayrak Koyun (Kırmızı Bayrak)

Sonra bayrağın içine bu kodu yerleştirin.

 [stextbox id=”alert”]this allowDamage false; this enableSimulation false; this setVariable [“gangNum”,”Gang_Area_2″, true];[/stextbox]

Bölgeye Bi İşaret Koyun Ve İşretin kodunu gang_cap_2 yapın

Lokasyon 3 için yapmanız gereken .

Bir Tane Flag_Red_F Kodlu Bir Bayrak Koyun (Kırmızı Bayrak)

Sonra bayrağın içine bu kodu yerleştirin.

 [stextbox id=”alert”]this allowDamage false; this enableSimulation false; this setVariable [“gangNum”,”Gang_Area_3″, true];[/stextbox]

Bölgeye Bi İşaret Koyun Ve İşretin kodunu gang_cap_3 yapın

Bunları Yaptıktan Sonra Alanın Etrafını 500m lik Bi Daire İle Kaplayın.

4.Adım stringtable.xml Dosyasının içine Aşağıdaki Kodları Ekleyin.

[stextbox id=”alert”]

<Package name=”Rg_GangCaputre”>
<Key ID=”STR_GNOTF_CaptureAreaAttemptPopo”>
<Original>%1 ve Polis Bir Alanı Ele Geçirmek İçin Müdahele Ediyor!</Original>
</Key>

<Key ID=”STR_GNOTF_CapturingArea”>
<Original>Ele Geçirme Alanı</Original>
</Key>

<Key ID=”STR_GNOTF_CapturedArea”>
<Original>Alan Ele Geçirildi.</Original>
</Key>

<Key ID=”STR_Gang_captuerr”>
<Original>Alanı Ele Geçirmek</Original>
</Key>

<Key ID=”STR_GNOTF_CaptureAreaSuccess”>
<Original>%1 ve Çetesi : %2 – Bir Alanı Ele Geçirdi</Original>
</Key>
</Package>

[/stextbox]

 

5.Adım fn_setupActuons.sqf a giriyoruz  west ve  civilian`nın altına bu kodu ekliyoruz.

[stextbox id=”alert”]//RgGangC

life_actions = life_actions + [player addAction[“<t color=‘#FF0000’>Çete Lokasyonunu Ele Geçir</t>“,life_fnc_areaCapture,””,0,false,false,””,’ ((typeOf cursorTarget) == “Flag_Red_F”) ‘]];[/stextbox]

 

Life_Server Dosyanızdan Devam Ediyoruz.

6.Adım life_server/functions/gang klasorunun içine yeni bi dosya oluşturuyoruz.

Dosya Adımız : fn_gangCash.sqf

Dosyanın İçine Aşşağıdaki Kodu Yapıştırıyoruz.

 [stextbox id=”alert”]

#include “\life_server\script_macros.hpp”
/*
File: fn_gangCash.sqf
Author: Rias Gremory”Berat Yıldız”
Telif Hakkı : https://www.beratyildiz.org/th/
Web Site : www.beratyildiz.org

Description:
Çete Bölgesi Ele Geçirme
*/

/*
#########################
# north outpost #
#########################
*/

//gets the flag locations
_area = [4870.743,21934.35,0] nearestObject “Flag_Red_F”;

//gets the gang names of the flag owners
_owner = _area getVariable [“gangOwner”,grpNull];

//get the gang funds
_gFund = _owner getVariable [“gang_bank”,0];

//set the new gang funds
_owner setVariable [“gang_bank”,round(_gFund+((count playableUnits)*2000)),true];

//push gang funds to DB
[1,_owner] call TON_fnc_updateGang;

/*
#########################
# south pen outpost #
#########################
*/

//gets the flag locations
_area2 = [11207.171,8699.596,0] nearestObject “Flag_Red_F”;

//gets the gang names of the flag owners
_owner = _area2 getVariable [“gangOwner”,grpNull];

//get the gang funds
_gFund = _owner getVariable [“gang_bank”,0];

//set the new gang funds
_owner setVariable [“gang_bank”,round(_gFund+((count playableUnits)*2000)),true];

//push gang funds to DB
[1,_owner] call TON_fnc_updateGang;

/*
#########################
# east outpost #
#########################
*/

//gets the flag locations
_area3 = [20079.65,6744.436,0] nearestObject “Flag_Red_F”;

//gets the gang names of the flag owners
_owner = _area3 getVariable [“gangOwner”,grpNull];

//get the gang funds
_gFund = _owner getVariable [“gang_bank”,0];

//set the new gang funds
_owner setVariable [“gang_bank”,round(_gFund+((count playableUnits)*2000)),true];

//push gang funds to DB
[1,_owner] call TON_fnc_updateGang;

//time between scripts
Sleep 900;

[] spawn TON_fnc_gangCash;

[/stextbox]

 

Şimdi, daha önce kaydedilen bayrakların yerleri, belirgin yerlerde yukarıdaki komut dosyasına konulması gerekir.

7.Adım config.cpp dosyasını açıyoruz class Gangs`ın altına aşağıdaki kodu ekliyoruz.

 [stextbox id=”alert”]

class gangCash {};

[/stextbox]

8.Adım init.sqf i açıyoruz ve [] spawn TON_fnc_initHouses; kodunun altına aşağıdaki kodu ekliyoruz.

 

 [stextbox id=”alert”]

[] spawn TON_fnc_gangCash;

[/stextbox]

Konu Bukadardı Umarım Size Yardımcı Olmuştur .

Bir Cevap Yazın

%d blogcu bunu beğendi: