• Из-за обновления 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) последний раз были обновлены:

How to mange green zone that the specific fraction can fight in there desired safe zone

dagar6424

Новый участник
25 Июн 2021
27
2
60
I have tried a function but that not working enough. Can someone modify that
private bool CanPlayerFightInSafeZone(ExtPlayer player, int index)
{
var sessionData = player.GetSessionData();
if (sessionData == null)
return false;


if (sessionData.Fraction == null)
return false;

var fracId = player.GetFractionId();


if (!sessionData.WorkData.OnDuty && Manager.FractionTypes.TryGetValue(fracId, out var fractionType))
{
switch ((ZoneName)index)
{
case ZoneName.LCN:
return fractionType == FractionsType.ARMY;
case ZoneName.lspd:
return fractionType == FractionsType.POLICE;
case ZoneName.EMS:
return fractionType == FractionsType.EMS;
default:
return true;
}
}

return false;
}
 

Jerry (ChatGPT)

AI-powered language model
VIP
helper
17 Окт 2023
2,414
238
100
It looks like your function is almost correct. There are a couple of things that can be improved:

1. Use sessionData.Fraction instead of sessionData.FractionId for checking the player's fraction.
2. The CanPlayerFightInSafeZone function seems to be deciding if a player can fight in a specific zone based on their faction. Make sure that Manager.FractionTypes contains the appropriate mappings for all the zone names.
3. You may want to make sure that fracId is not null before using it in the Manager.FractionTypes.TryGetValue(fracId, out var fractionType) line.

Other than that, the function should work if the necessary data (like Manager.FractionTypes) is set up properly.
 

dagar6424

Новый участник
25 Июн 2021
27
2
60
It looks like your function is almost correct. There are a couple of things that can be improved:

1. Use sessionData.Fraction instead of sessionData.FractionId for checking the player's fraction.
2. The CanPlayerFightInSafeZone function seems to be deciding if a player can fight in a specific zone based on their faction. Make sure that Manager.FractionTypes contains the appropriate mappings for all the zone names.
3. You may want to make sure that fracId is not null before using it in the Manager.FractionTypes.TryGetValue(fracId, out var fractionType) line.

Other than that, the function should work if the necessary data (like Manager.FractionTypes) is set up properly.
Can u give modified code
 

dagar6424

Новый участник
25 Июн 2021
27
2
60
private bool CanPlayerFightInSafeZone(ExtPlayer player, int index)
{
var sessionData = player.GetSessionData();
if (sessionData == null)
return false;
var playerFraction = sessionData.Fraction;
if (playerFraction == null)
return false;
var fractionType = playerFraction.Type;
if (fractionType == FractionsType.NONE)
return false;
switch ((ZoneName)index)
{
case ZoneName.LCN:
return fractionType == FractionsType.ARMY
case ZoneName.lspd:
return fractionType == FractionsType.POLICE;
case ZoneName.EMS:
return fractionType == FractionsType.EMS;
default:
return true;
}
}