Bonjour, j'ai déjà cacher les points illégaux sur la carte avec ce Scrpit: https://www.altisliferpg.com/topic/602-tutorial-hidding-markers-from-police/
Cependant, avec ce code, lorsqu'on se connecte pour la première fois dans le menu spawn on voit tous les points sur la carte. Je voulais m'inspirer du code du Fuel System qui fait que si on a pas la liscense Fuel, qu'on ne voit pas les Stations vides... Je vous laisse mon Survival:
Merci !
[CODE title="survival"]#include "..\script_macros.hpp"
/*
File: fn_survival.sqf
Author: Bryan "Tonic" Boardwine
Description:
All survival? things merged into one thread.
*/
private ["_fnc_food","_fnc_water","_foodTime","_waterTime","_bp","_walkDis","_lastPos","_illegalcocaine","_illegalepi","_cientifdiqueada","_mdma","_uranium","_uranium1","_mush","_illegalheroine","_illegalweed","_curPos"];
_fnc_food = {
if (life_hunger < 2) then {player setDamage 1; hint localize "STR_NOTF_EatMSG_Death";}
else
{
life_hunger = life_hunger - 10;
[] call life_fnc_hudUpdate;
if (life_hunger < 2) then {player setDamage 1; hint localize "STR_NOTF_EatMSG_Death";};
switch (life_hunger) do {
case 30: {hint localize "STR_NOTF_EatMSG_1";};
case 20: {hint localize "STR_NOTF_EatMSG_2";};
case 10: {
hint localize "STR_NOTF_EatMSG_3";
if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 1;};
};
};
};
};
_fnc_water = {
if (life_thirst < 2) then {player setDamage 1; hint localize "STR_NOTF_DrinkMSG_Death";}
else
{
life_thirst = life_thirst - 10;
[] call life_fnc_hudUpdate;
if (life_thirst < 2) then {player setDamage 1; hint localize "STR_NOTF_DrinkMSG_Death";};
switch (life_thirst) do {
case 30: {hint localize "STR_NOTF_DrinkMSG_1";};
case 20: {
hint localize "STR_NOTF_DrinkMSG_2";
if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 1;};
};
case 10: {
hint localize "STR_NOTF_DrinkMSG_3";
if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 1;};
};
};
};
};
_illegalcocaine = ["cocaine_1","cocaine processing"];
if (!license_civ_cocaine) then {
{ deleteMarkerLocal _x; } forEach _illegalcocaine;
};
_illegalepi = ["epi_1","OilP_1"];
if (!license_civ_epiunprocess) then {
{ deleteMarkerLocal _x; } forEach _illegalepi;
};
_cientifdiqueada = ["cientifdiqueada","mickel_1"];
if (!license_civ_mickelange) then {
{ deleteMarkerLocal _x; } forEach _cientifdiqueada;
};
_mdma = ["ecstasy_1","ecstasy_2"];
if (!license_civ_ecstasy) then {
{ deleteMarkerLocal _x; } forEach _mdma;
};
_mush = ["rock_quarry_1"];
if (!license_civ_spore_unprocess) then {
{ deleteMarkerLocal _x; } forEach _mush;
};
_uranium = ["oil_trader_8"];
if (!license_civ_uranium03) then {
{ deleteMarkerLocal _x; } forEach _uranium;
};
_uranium1 = ["oil_trader_9","oil_trader_10"];
if (!license_civ_uranium04) then {
{ deleteMarkerLocal _x; } forEach _uranium1;
};
_illegalheroine = ["heroin_1","heroin_p"];
if (!license_civ_heroin) then {
{ deleteMarkerLocal _x; } forEach _illegalheroine;
};
_illegalweed = ["weed_1","Weed_p_1"];
if (!license_civ_marijuana) then {
{ deleteMarkerLocal _x; } forEach _illegalweed;
};
//Setup the time-based variables.
_foodTime = time;
_waterTime = time;
_walkDis = 0;
_bp = "";
_lastPos = visiblePosition player;
_lastPos = (_lastPos select 0) + (_lastPos select 1);
_lastState = vehicle player;
for "_i" from 0 to 1 step 0 do {
/* Thirst / Hunger adjustment that is time based */
if ((time - _waterTime) > 600 && {!life_god}) then {[] call _fnc_water; _waterTime = time;};
if ((time - _foodTime) > 850 && {!life_god}) then {[] call _fnc_food; _foodTime = time;};
/* Adjustment of carrying capacity based on backpack changes */
if (backpack player isEqualTo "") then {
life_maxWeight = LIFE_SETTINGS(getNumber,"total_maxWeight");
_bp = backpack player;
} else {
if (!(backpack player isEqualTo "") && {!(backpack player isEqualTo _bp)}) then {
_bp = backpack player;
life_maxWeight = LIFE_SETTINGS(getNumber,"total_maxWeight") + round(FETCH_CONFIG2(getNumber,"CfgVehicles",_bp,"maximumload") / 4);
};
};
/* Check if the player's state changed? */
if (!(vehicle player isEqualTo _lastState) || {!alive player}) then {
[] call life_fnc_updateViewDistance;
_lastState = vehicle player;
};
/* Check if the weight has changed and the player is carrying to much */
if (life_carryWeight > life_maxWeight && {!isForcedWalk player} && {!life_god}) then {
player forceWalk true;
if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 1;};
hint localize "STR_NOTF_MaxWeight";
} else {
if (isForcedWalk player) then {
player forceWalk false;
};
};
/* Travelling distance to decrease thirst/hunger which is captured every second so the distance is actually greater then 650 */
if (!alive player || {life_god}) then {_walkDis = 0;} else {
_curPos = visiblePosition player;
_curPos = (_curPos select 0) + (_curPos select 1);
if (!(_curPos isEqualTo _lastPos) && {(isNull objectParent player)}) then {
_walkDis = _walkDis + 1;
if (_walkDis isEqualTo 650) then {
_walkDis = 0;
life_thirst = life_thirst - 5;
life_hunger = life_hunger - 5;
[] call life_fnc_hudUpdate;
};
};
_lastPos = visiblePosition player;
_lastPos = (_lastPos select 0) + (_lastPos select 1);
};
uiSleep 1;
};
[/CODE]
Cependant, avec ce code, lorsqu'on se connecte pour la première fois dans le menu spawn on voit tous les points sur la carte. Je voulais m'inspirer du code du Fuel System qui fait que si on a pas la liscense Fuel, qu'on ne voit pas les Stations vides... Je vous laisse mon Survival:
Merci !
[CODE title="survival"]#include "..\script_macros.hpp"
/*
File: fn_survival.sqf
Author: Bryan "Tonic" Boardwine
Description:
All survival? things merged into one thread.
*/
private ["_fnc_food","_fnc_water","_foodTime","_waterTime","_bp","_walkDis","_lastPos","_illegalcocaine","_illegalepi","_cientifdiqueada","_mdma","_uranium","_uranium1","_mush","_illegalheroine","_illegalweed","_curPos"];
_fnc_food = {
if (life_hunger < 2) then {player setDamage 1; hint localize "STR_NOTF_EatMSG_Death";}
else
{
life_hunger = life_hunger - 10;
[] call life_fnc_hudUpdate;
if (life_hunger < 2) then {player setDamage 1; hint localize "STR_NOTF_EatMSG_Death";};
switch (life_hunger) do {
case 30: {hint localize "STR_NOTF_EatMSG_1";};
case 20: {hint localize "STR_NOTF_EatMSG_2";};
case 10: {
hint localize "STR_NOTF_EatMSG_3";
if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 1;};
};
};
};
};
_fnc_water = {
if (life_thirst < 2) then {player setDamage 1; hint localize "STR_NOTF_DrinkMSG_Death";}
else
{
life_thirst = life_thirst - 10;
[] call life_fnc_hudUpdate;
if (life_thirst < 2) then {player setDamage 1; hint localize "STR_NOTF_DrinkMSG_Death";};
switch (life_thirst) do {
case 30: {hint localize "STR_NOTF_DrinkMSG_1";};
case 20: {
hint localize "STR_NOTF_DrinkMSG_2";
if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 1;};
};
case 10: {
hint localize "STR_NOTF_DrinkMSG_3";
if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 1;};
};
};
};
};
_illegalcocaine = ["cocaine_1","cocaine processing"];
if (!license_civ_cocaine) then {
{ deleteMarkerLocal _x; } forEach _illegalcocaine;
};
_illegalepi = ["epi_1","OilP_1"];
if (!license_civ_epiunprocess) then {
{ deleteMarkerLocal _x; } forEach _illegalepi;
};
_cientifdiqueada = ["cientifdiqueada","mickel_1"];
if (!license_civ_mickelange) then {
{ deleteMarkerLocal _x; } forEach _cientifdiqueada;
};
_mdma = ["ecstasy_1","ecstasy_2"];
if (!license_civ_ecstasy) then {
{ deleteMarkerLocal _x; } forEach _mdma;
};
_mush = ["rock_quarry_1"];
if (!license_civ_spore_unprocess) then {
{ deleteMarkerLocal _x; } forEach _mush;
};
_uranium = ["oil_trader_8"];
if (!license_civ_uranium03) then {
{ deleteMarkerLocal _x; } forEach _uranium;
};
_uranium1 = ["oil_trader_9","oil_trader_10"];
if (!license_civ_uranium04) then {
{ deleteMarkerLocal _x; } forEach _uranium1;
};
_illegalheroine = ["heroin_1","heroin_p"];
if (!license_civ_heroin) then {
{ deleteMarkerLocal _x; } forEach _illegalheroine;
};
_illegalweed = ["weed_1","Weed_p_1"];
if (!license_civ_marijuana) then {
{ deleteMarkerLocal _x; } forEach _illegalweed;
};
//Setup the time-based variables.
_foodTime = time;
_waterTime = time;
_walkDis = 0;
_bp = "";
_lastPos = visiblePosition player;
_lastPos = (_lastPos select 0) + (_lastPos select 1);
_lastState = vehicle player;
for "_i" from 0 to 1 step 0 do {
/* Thirst / Hunger adjustment that is time based */
if ((time - _waterTime) > 600 && {!life_god}) then {[] call _fnc_water; _waterTime = time;};
if ((time - _foodTime) > 850 && {!life_god}) then {[] call _fnc_food; _foodTime = time;};
/* Adjustment of carrying capacity based on backpack changes */
if (backpack player isEqualTo "") then {
life_maxWeight = LIFE_SETTINGS(getNumber,"total_maxWeight");
_bp = backpack player;
} else {
if (!(backpack player isEqualTo "") && {!(backpack player isEqualTo _bp)}) then {
_bp = backpack player;
life_maxWeight = LIFE_SETTINGS(getNumber,"total_maxWeight") + round(FETCH_CONFIG2(getNumber,"CfgVehicles",_bp,"maximumload") / 4);
};
};
/* Check if the player's state changed? */
if (!(vehicle player isEqualTo _lastState) || {!alive player}) then {
[] call life_fnc_updateViewDistance;
_lastState = vehicle player;
};
/* Check if the weight has changed and the player is carrying to much */
if (life_carryWeight > life_maxWeight && {!isForcedWalk player} && {!life_god}) then {
player forceWalk true;
if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 1;};
hint localize "STR_NOTF_MaxWeight";
} else {
if (isForcedWalk player) then {
player forceWalk false;
};
};
/* Travelling distance to decrease thirst/hunger which is captured every second so the distance is actually greater then 650 */
if (!alive player || {life_god}) then {_walkDis = 0;} else {
_curPos = visiblePosition player;
_curPos = (_curPos select 0) + (_curPos select 1);
if (!(_curPos isEqualTo _lastPos) && {(isNull objectParent player)}) then {
_walkDis = _walkDis + 1;
if (_walkDis isEqualTo 650) then {
_walkDis = 0;
life_thirst = life_thirst - 5;
life_hunger = life_hunger - 5;
[] call life_fnc_hudUpdate;
};
};
_lastPos = visiblePosition player;
_lastPos = (_lastPos select 0) + (_lastPos select 1);
};
uiSleep 1;
};
[/CODE]