• Из-за обновления GTA 5 (был добавлен новый патч) может временно не работать вход в RAGE Multiplayer.

    Ошибка: Ваша версия Grand Theft Auto V не поддерживается RAGE Multiplayer.
    ERROR: Your game version is not supported by RAGE Multiplayer.

    Данная ошибка говорит о том, что GTA V обновилась до новой версии (GTA Online тоже). Вам необходимо обновить саму игру в главном меню вашего приложения (Steam / Epic Games / Rockstar Games).
    Если после этого RAGE:MP все равно не работает - вам нужно дождаться выхода патча для самого мультиплеера (обычно это занимает от нескольких часов до нескольких дней).

    Новости и апдейты Rockstar Games - https://www.rockstargames.com/newswire/
    Статус всех служб для Rockstar Games Launcher и поддерживаемых игр: https://support.rockstargames.com/ru/servicestatus


    Grand Theft Auto 5 (+ GTA Online) последний раз были обновлены:

Вопрос Safezone (Greenzone) in redage v3

maverickhath

Участник портала
14 Апр 2024
94
9
17
Как добавить новую зеленую зону в Redage v3, мне нужно установить область в зеленую зону, пожалуйста, помогите и дайте мне знать, какой файл содержит данные безопасной зоны или зеленой зоны в Redage v3
 

Jerry (ChatGPT)

AI-powered language model
VIP
helper
17 Окт 2023
2,490
239
100
In redage v3, the Greenzone data can usually be found in the server configuration files, such as server.cfg or mtaserver.conf. To add a new Greenzone, you typically need to specify the coordinates of the zone and its radius within these configuration files. Make sure to consult the redage v3 documentation or community resources for specific instructions tailored to your server setup.
 

maverickhath

Участник портала
14 Апр 2024
94
9
17
here is the project on which im working on
 

Вложения

  • Interface.png
    Interface.png
    1 MB · Просмотры: 152
  • RoflanEbalo
Реакции: Inoi

maverickhath

Участник портала
14 Апр 2024
94
9
17
its not relevent
C#:
using System;
using System.Collections.Generic;
using GTANetworkAPI;
using Localization;
using NeptuneEvo.Handles;

using NeptuneEvo.Players;
using NeptuneEvo.Functions;
using NeptuneEvo.Quests;
using Redage.SDK;
using NeptuneEvo.Character;

namespace NeptuneEvo.Core
{
    class SafeZones : Script
    {
        private static readonly nLog Log = new nLog("Core.SafeZones");

        private static List<int> GreenZoneDisabled = new List<int>();
        
        public enum ZoneName
        {
            lspd = 1,
            MafiaGame2 = 2,
            MafiaGame1 = 3,
            Ticket = 4,
            EMS = 5,
            EMSpark = 6,
            Bloods = 7,
            Families = 8,
            MG13 = 9,
            Ballas = 10,
            LCN = 11,
            PDPARK = 12,
            YAK = 13,
            Cityhall = 14,
            ArmenianPark = 15,
            AM = 16,
            RM = 17,
            Agency = 18,
            Tequila = 19,
            ByVitalya = 20,
            Sheriffs2 = 21,
            Sheriffs = 22,
            govfib = 23,
            Court = 24,
            Iglesia = 25,
            SaleTrees = 26,
            SaleOres = 27,
            GovMine = 29,
            Tent2 = 30,
            TentBeach = 31,
            BySource3 = 32,
            BySource2 = 33,
            BySource1 = 34,
            kazikulica = 35,
            lesnik3 = 37,
            lesnik = 38,
            bagama = 39,
            vanilla = 40,
            lesnik2 = 41,
            lesnik4 = 42,
            lesink5 = 43,
            lesnik6 = 44,
            mine4 = 45,
            mine3 = 46,
            mine2 = 47,
            mine1 = 48,
            govmineold = 49,
            lsnews = 50,
            questems2 = 51,
            questems = 52,
            eventsarena = 53,
            DonateShopNew = 54,
            BUS1 = 55,
            MatWarZone = 56,
            Spawn = 57,
            Organization = 58,
            authschool = 59,
            TAXI = 60,
            Hotel3 = 61,
            Hotel2 = 62,
            Hotel1 = 63,
            electric = 64,
            automech = 65,
            collector = 66,
            trucker = 67,
            gopostal = 68,
            kazikinside = 69,
            vagos = 70,
            GolfCourse = 71,
            NGBase = 72,
            EMSStreet = 74,
            BeachParty2 = 77,
            LumberJob = 78,
            MiningJob = 79,
            OriginalArena = 80,
            FiB = 81,
            NGCityBase = 83,
            Arena = 84

        }

        public static bool IsSafeZone(int index, ZoneName name) => index == (int) name;

        [RemoteEvent("IsSafeZone")]
        public void IsSafeZone(ExtPlayer player, bool toggled)
        {
            try
            {
                var sessionData = player.GetSessionData();

                if (sessionData == null) return;
                
                sessionData.IsSafeZone = toggled;
                
                player.SetSharedData("SZ", toggled);
            }
            catch (Exception e)
            {
                Log.Write($"OpenInventory Exception: {e.ToString()}");
            }
        }
        [RemoteEvent("inGreenZone")]
        public void InSafeZone(ExtPlayer player, int index)
        {
            var sessionData = player.GetSessionData();
            if (sessionData == null)
                return;
            
            if (!GreenZoneDisabled.Contains(index) && !sessionData.WarData.IsWarZone)
                Trigger.ClientEvent(player, "safeZone", true);
                
            if (IsSafeZone(index, ZoneName.EMS))
                qMain.UpdateQuestsStage(player, Zdobich.QuestName, (int)zdobich_quests.Stage31, 1, isUpdateHud: true);
                
            if (IsSafeZone(index, ZoneName.lspd))
                qMain.UpdateQuestsStage(player, Zdobich.QuestName, (int)zdobich_quests.Stage33, 1, isUpdateHud: true);
                
            sessionData.InsideSafeZone = index;
        }
        
        [RemoteEvent("outGreenZone")]
        public void OutSafeZone(ExtPlayer player, int index)
        {

            var sessionData = player.GetSessionData();

            if (sessionData == null) return;
            
            if (!GreenZoneDisabled.Contains(index))
                Trigger.ClientEvent(player, "safeZone", false);
            
            if (sessionData.InsideSafeZone == index)
                sessionData.InsideSafeZone = -1;

        }
        [Command(AdminCommands.Szstate)]
        public static void CMD_SZState(ExtPlayer player, int sz) // command /szstate [id] - turns specified Green Zone ON or OFF
        {
            try
            {
                // check if the player has access to this admin command
                if (!CommandsAccess.CanUseCmd(player, AdminCommands.Szstate)) return;
                
                var state = GreenZoneDisabled.Contains(sz);
                ChangeDamageState(sz, state);

                // get all the character data for the person using this command
                var characterData = player.GetCharacterData();

                // check to see if GZ is enabled or disabled, send notifications and update admin logs and database
                if (!state)
                {
                    Admin.AdminsLog(characterData.AdminLVL, $"{Chars.Models.ChatColors.Red}[WARNING] {Chars.Models.ChatColors.AdminChat}{player.Name.Replace('_', ' ')} ({characterData.UUID}) DISABLED Green Zone ({sz})", 2, "#D289FF", true, hideAdminLevel: 6);
                    GameLog.Admin($"{player.Name.Replace('_', ' ')} ({characterData.UUID})", $"DISABLED Green Zone ({sz})", $"");
                }
                else
                {
                    Admin.AdminsLog(characterData.AdminLVL, $"{Chars.Models.ChatColors.Green}[SUCCESS] {Chars.Models.ChatColors.AdminChat}{player.Name.Replace('_', ' ')} ({characterData.UUID}) ENABLED Green Zone ({sz})", 2, "#D289FF", true, hideAdminLevel: 6);
                    GameLog.Admin($"{player.Name.Replace('_', ' ')} ({characterData.UUID})", $"ENABLED Green Zone ({sz})", $"");
                }

                if (!state)
                    GreenZoneDisabled.Add(sz);
                else
                    GreenZoneDisabled.Remove(sz);
            }
            catch (Exception e)
            {
                Log.Write($"CMD_SZState Exception: {e.ToString()}");
            }
        }

        public static void ChangeDamageState(int sz, bool state) // allows you to enable or disable the ability to fight in any available safe zone by key
        {
            try
            {
                foreach (ExtPlayer foreachPlayer in NeptuneEvo.Character.Repository.GetPlayers())
                {
                    try
                    {

                        var foreachSessionData = foreachPlayer.GetSessionData();

                        if (foreachSessionData == null) continue;
                        if (foreachSessionData.InsideSafeZone == sz)
                        {
                            if (state)
                                Trigger.ClientEvent(foreachPlayer, "safeZone", true);
                            else
                                Trigger.ClientEvent(foreachPlayer, "safeZone", false);
                        }
                    }
                    catch (Exception e)
                    {
                        Log.Write($"ChangeDamageState Foreach Exception: {e.ToString()}");
                    }
                }
            }
            catch (Exception e)
            {
                Log.Write($"ChangeDamageState Exception: {e.ToString()}");
            }
        }
    }
}
 

Inoi

/dev/null
Команда форума
Moderator
VIP
15 Окт 2020
4,222
2,075
208
35
its not relevent
C#:
using System;
using System.Collections.Generic;
using GTANetworkAPI;
using Localization;
using NeptuneEvo.Handles;

using NeptuneEvo.Players;
using NeptuneEvo.Functions;
using NeptuneEvo.Quests;
using Redage.SDK;
using NeptuneEvo.Character;

namespace NeptuneEvo.Core
{
    class SafeZones : Script
    {
        private static readonly nLog Log = new nLog("Core.SafeZones");

        private static List<int> GreenZoneDisabled = new List<int>();
       
        public enum ZoneName
        {
            lspd = 1,
            MafiaGame2 = 2,
            MafiaGame1 = 3,
            Ticket = 4,
            EMS = 5,
            EMSpark = 6,
            Bloods = 7,
            Families = 8,
            MG13 = 9,
            Ballas = 10,
            LCN = 11,
            PDPARK = 12,
            YAK = 13,
            Cityhall = 14,
            ArmenianPark = 15,
            AM = 16,
            RM = 17,
            Agency = 18,
            Tequila = 19,
            ByVitalya = 20,
            Sheriffs2 = 21,
            Sheriffs = 22,
            govfib = 23,
            Court = 24,
            Iglesia = 25,
            SaleTrees = 26,
            SaleOres = 27,
            GovMine = 29,
            Tent2 = 30,
            TentBeach = 31,
            BySource3 = 32,
            BySource2 = 33,
            BySource1 = 34,
            kazikulica = 35,
            lesnik3 = 37,
            lesnik = 38,
            bagama = 39,
            vanilla = 40,
            lesnik2 = 41,
            lesnik4 = 42,
            lesink5 = 43,
            lesnik6 = 44,
            mine4 = 45,
            mine3 = 46,
            mine2 = 47,
            mine1 = 48,
            govmineold = 49,
            lsnews = 50,
            questems2 = 51,
            questems = 52,
            eventsarena = 53,
            DonateShopNew = 54,
            BUS1 = 55,
            MatWarZone = 56,
            Spawn = 57,
            Organization = 58,
            authschool = 59,
            TAXI = 60,
            Hotel3 = 61,
            Hotel2 = 62,
            Hotel1 = 63,
            electric = 64,
            automech = 65,
            collector = 66,
            trucker = 67,
            gopostal = 68,
            kazikinside = 69,
            vagos = 70,
            GolfCourse = 71,
            NGBase = 72,
            EMSStreet = 74,
            BeachParty2 = 77,
            LumberJob = 78,
            MiningJob = 79,
            OriginalArena = 80,
            FiB = 81,
            NGCityBase = 83,
            Arena = 84

        }

        public static bool IsSafeZone(int index, ZoneName name) => index == (int) name;

        [RemoteEvent("IsSafeZone")]
        public void IsSafeZone(ExtPlayer player, bool toggled)
        {
            try
            {
                var sessionData = player.GetSessionData();

                if (sessionData == null) return;
               
                sessionData.IsSafeZone = toggled;
               
                player.SetSharedData("SZ", toggled);
            }
            catch (Exception e)
            {
                Log.Write($"OpenInventory Exception: {e.ToString()}");
            }
        }
        [RemoteEvent("inGreenZone")]
        public void InSafeZone(ExtPlayer player, int index)
        {
            var sessionData = player.GetSessionData();
            if (sessionData == null)
                return;
           
            if (!GreenZoneDisabled.Contains(index) && !sessionData.WarData.IsWarZone)
                Trigger.ClientEvent(player, "safeZone", true);
               
            if (IsSafeZone(index, ZoneName.EMS))
                qMain.UpdateQuestsStage(player, Zdobich.QuestName, (int)zdobich_quests.Stage31, 1, isUpdateHud: true);
               
            if (IsSafeZone(index, ZoneName.lspd))
                qMain.UpdateQuestsStage(player, Zdobich.QuestName, (int)zdobich_quests.Stage33, 1, isUpdateHud: true);
               
            sessionData.InsideSafeZone = index;
        }
       
        [RemoteEvent("outGreenZone")]
        public void OutSafeZone(ExtPlayer player, int index)
        {

            var sessionData = player.GetSessionData();

            if (sessionData == null) return;
           
            if (!GreenZoneDisabled.Contains(index))
                Trigger.ClientEvent(player, "safeZone", false);
           
            if (sessionData.InsideSafeZone == index)
                sessionData.InsideSafeZone = -1;

        }
        [Command(AdminCommands.Szstate)]
        public static void CMD_SZState(ExtPlayer player, int sz) // command /szstate [id] - turns specified Green Zone ON or OFF
        {
            try
            {
                // check if the player has access to this admin command
                if (!CommandsAccess.CanUseCmd(player, AdminCommands.Szstate)) return;
               
                var state = GreenZoneDisabled.Contains(sz);
                ChangeDamageState(sz, state);

                // get all the character data for the person using this command
                var characterData = player.GetCharacterData();

                // check to see if GZ is enabled or disabled, send notifications and update admin logs and database
                if (!state)
                {
                    Admin.AdminsLog(characterData.AdminLVL, $"{Chars.Models.ChatColors.Red}[WARNING] {Chars.Models.ChatColors.AdminChat}{player.Name.Replace('_', ' ')} ({characterData.UUID}) DISABLED Green Zone ({sz})", 2, "#D289FF", true, hideAdminLevel: 6);
                    GameLog.Admin($"{player.Name.Replace('_', ' ')} ({characterData.UUID})", $"DISABLED Green Zone ({sz})", $"");
                }
                else
                {
                    Admin.AdminsLog(characterData.AdminLVL, $"{Chars.Models.ChatColors.Green}[SUCCESS] {Chars.Models.ChatColors.AdminChat}{player.Name.Replace('_', ' ')} ({characterData.UUID}) ENABLED Green Zone ({sz})", 2, "#D289FF", true, hideAdminLevel: 6);
                    GameLog.Admin($"{player.Name.Replace('_', ' ')} ({characterData.UUID})", $"ENABLED Green Zone ({sz})", $"");
                }

                if (!state)
                    GreenZoneDisabled.Add(sz);
                else
                    GreenZoneDisabled.Remove(sz);
            }
            catch (Exception e)
            {
                Log.Write($"CMD_SZState Exception: {e.ToString()}");
            }
        }

        public static void ChangeDamageState(int sz, bool state) // allows you to enable or disable the ability to fight in any available safe zone by key
        {
            try
            {
                foreach (ExtPlayer foreachPlayer in NeptuneEvo.Character.Repository.GetPlayers())
                {
                    try
                    {

                        var foreachSessionData = foreachPlayer.GetSessionData();

                        if (foreachSessionData == null) continue;
                        if (foreachSessionData.InsideSafeZone == sz)
                        {
                            if (state)
                                Trigger.ClientEvent(foreachPlayer, "safeZone", true);
                            else
                                Trigger.ClientEvent(foreachPlayer, "safeZone", false);
                        }
                    }
                    catch (Exception e)
                    {
                        Log.Write($"ChangeDamageState Foreach Exception: {e.ToString()}");
                    }
                }
            }
            catch (Exception e)
            {
                Log.Write($"ChangeDamageState Exception: {e.ToString()}");
            }
        }
    }
}
u need to spend more than a minute of your time to have a picture about how it work
 
Реакции: maverickhath

Similar threads