Exemple #1
0
    /// <summary>
    /// Sets up all correctly configured PlayerPed
    /// </summary>
    private void SetupPlayerPeds()
    {
        foreach (UserIndex player in userIndices)
        {
            if (bool.Parse(PlayerSettings.GetValue(player, EnabledKey, false.ToString())))
            {
                string guid = PlayerSettings.GetValue(player, ControllerKey, "");

                foreach (InputManager input in InputManager.GetAvailableInputManagers())
                {
                    if (input.DeviceGuid.Equals(guid))
                    {
                        InputManager manager = input;
                        if (input is DirectInputManager)
                        {
                            manager = DirectInputManager.LoadConfig(((DirectInputManager)input).device, GetIniFile());
                        }

                        PedHash    characterHash = PlayerSettings.GetEnumValue <PedHash>(player, CharacterHashKey, PedHash.Trevor.ToString());
                        BlipSprite blipSprite    = PlayerSettings.GetEnumValue <BlipSprite>(player, BlipSpriteKey, BlipSprite.Standard.ToString());
                        BlipColor  blipColor     = PlayerSettings.GetEnumValue <BlipColor>(player, BlipColorKey, BlipColor.Green.ToString());

                        PlayerPed playerPed = new PlayerPed(player, characterHash, blipSprite, blipColor, player1, manager);
                        playerPeds.Add(playerPed);
                        break;
                    }
                }
            }
        }
    }