Jump to content

Vladislav Gnatovskyi

Members
  • Posts

    15
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Vladislav Gnatovskyi

  1. Hi, people. I found a problem. If you replace the system dll in the runtime folder and start the server, you will have no problems. But if you run the launcher first, you will need to update the dll again.

  2. Hi guys. How fix problem? file enable-clientside-cs.txt exists in RAGEMP folder.

    System.Private.CoreLib
       at System.Reflection.Emit.InternalAssemblyBuilder.get_Location()
    The invoked member is not supported in a dynamic assembly.
    The invoked member is not supported in a dynamic assembly.


    Client file

    using RAGE;
    
    namespace Simple.Client
    {
        public class AuthorizeEvent : Events.Script
        {
            public AuthorizeEvent()
            {            
                Events.OnPlayerChat += OnPlayerChat;
            }
    
            private void OnPlayerChat(string text, Events.CancelEventArgs cancel)
            {
                Chat.Output("TestClient");
                Chat.Output(text);
            }
        }
    }

     

  3. What's the problem is that they are not created and displayed.

    NAPI.Marker.CreateMarker(2, client.Position, client.Position, new Vector3(), 10f, new Color(164, 26, 0), true, 1);
    NAPI.TextLabel.CreateTextLabel("My Text", client.Position, 10F, 3, 2, new Color(164, 26, 0), false, 2);
               

     

  4. Exception message: Unable to load one or more of the requested types.
    Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
    
    Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
    
    System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
    File name: 'Microsoft.EntityFrameworkCore, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
    
    System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
    File name: 'Microsoft.EntityFrameworkCore, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'

    Where is add assembly?

  5. [Command("todo", GreedyArg = true)]
    public void CMD_TODOACTION(Client player, string action)
    {
      var actions = action.Split('*');
      if (actions.Length > 1)
      {
    	 ChatHandler.SendChatMessage(Settings.RADIUS / 2, player, $"- {actions[0]}. {Properties.COLOR_PURPLE}- said {player.Name}{actions[1]}.");
      }
    }
    
    

     

    • Like 1
  6. В 15.01.2018 в 01:15, SkyLaGer сказал:

    Наверняка есть такие люди, которые хотят начать разрабатывать свои проекты с C#, но, возможно, у них возникают вопросы о том, как начать. В этом мануале написано как начать. Подойдет для тех, кто хочет быстро "влиться " в тему. 

    Из мануала вы узнаете 

    1. Как установить SDK .NET Core 2.0
    2. Как создать проект в Visual Studio 2017
    3. Как добавить NuGet пакеты в свой проект

    Автор: NozmaD 

    СкачатьЯ.Диск

    Будет ли вторая часть?

  7. Здравствуйте! Представляю для вас пример исполнения команды /weapon unit id где:

    unit - это блок оружия а имеено:

    • Handguns
    • Machine
    • Assault
    • Sniper
    • ShotGun
    • Heavy
    • Thorow

    id это само оружие в блоке

    Для начала работи - нам нужно в паке "events" создать файл "weapon.js"

    Затем объявляем в нём глобальную переменную:

    global.weapon = 
    {
      
    };

     После объявляєм сам unit (блок), в котором будет находиться определеный тип оружия. Вставляем между фигурных скобок: 

    Handguns: mp.joaat(["weapon_pistol"])

    Полный код файла "weapon.js":

    global.weapon=
    {
    Handguns: mp.joaat(["weapon_pistol",
    	"weapon_CombatPistol",
    	"weapon_Pistol50",
    	"weapon_SNSPistol",
    	"weapon_HeavyPistol",
    	"weapon_VintagePistol",
    	"weapon_MarksmanPistol",
    	"weapon_revolver",
    	"weapon_APPistol",
    	"weapon_StunGun",
    	"weapon_FlareGun"]),
    Machine: mp.joaat(["weapon_MachinePistol",
    	"weapon_SMG",
    	"weapon_AssaultSMG",
    	"weapon_CombatPDW",
    	"weapon_MG",
    	"weapon_CombatMG",
    	"weapon_Gusenberg",
    	"weapon_MiniSMG"]),
    Assault: mp.joaat(["weapon_assaultrifle",
    	"weapon_carbinerifle",
    	"weapon_advancedrifle",
    	"weapon_specialcarbine",
    	"weapon_bullpuprifle",
    	"weapon_compactrifle"]),
    Sniper: mp.joaat(["weapon_SniperRifle",
    	"weapon_heavySniper",
    	"weapon_MarksmanRifle"]),
    ShotGun: mp.joaat(["weapon_pumpShotgun",
    	"weapon_SawnoffShotgun",
    	"weapon_bullpupshotgun",
    	"weapon_assaultshotgun",
    	"weapon_musket",
    	"weapon_HeavyShotgun",
    	"weapon_AutoShotgun"]),
    Heavy: mp.joaat(["weapon_grenadelauncher",
    	"weapon_RPG",
    	"weapon_Minigun",
    	"weapon_Firework",
    	"weapon_Railgun",
    	"weapon_HomingLauncher"]),
    Thorow: mp.joaat(["weapon_Grenade",
    	"weapon_StickyBomb",
    	"weapon_Proximitymine",
    	"weapon_BZGas",
    	"weapon_Molotov",
    	"weapon_Flare",
    	"weapon_PetrolCan",
    	"weapon_FireExtinguisher"])
    };

    Теперь нам нужно создать саму команду, которая будет вызывать наш блок, тип оружия.

    После сохранения файла, открываем файл который находиться в паке "commands" - "basiccommands.js"

    В нем нужно найти команду /weapon и заменить её кодом ниже:

    "weapon": (player, args) =>
    	{
    		let id = parseInt(args[1]);
    		switch (id){
    		case 0:{if (args[2]>=0 && args[2]<=10){player.giveWeapon(weapon.Handguns[args[2]],1000);
    		player.outputChatBox("Weapon: "+args[2]+" of unit Handguns");}else player.outputChatBox("Use /weapon 0 [0-10]");break;}
    		case 1:{if (args[2]>=0 && args[2]<=7){player.giveWeapon(weapon.Machine[args[2]],1000);
    		player.outputChatBox("Weapon: "+args[2]+" of unit Machine");}else player.outputChatBox("Use /weapon 1 [0-7]");break;}
    		case 2:{if (args[2]>=0 && args[2]<=5){player.giveWeapon(weapon.Assault[args[2]],1000);
    		player.outputChatBox("Weapon: "+args[2]+" of unit Assault");}else player.outputChatBox("Use /weapon 2 [0-5]");break;}
    		case 3:{if (args[2]>=0 && args[2]<=2){player.giveWeapon(weapon.Sniper[args[2]],1000);
    		player.outputChatBox("Weapon: "+args[2]+" of unit Sniper");}else player.outputChatBox("Use /weapon 3 [0-2]");break;}
    		case 4:{if (args[2]>=0 && args[2]<=6){player.giveWeapon(weapon.ShotGun[args[2]],1000);
    		player.outputChatBox("Weapon: "+args[2]+" of unit ShotGun");}else player.outputChatBox("Use /weapon 4 [0-6]");break;}
    		case 5:{if (args[2]>=0 && args[2]<=5){player.giveWeapon(weapon.Heavy[args[2]],1000);
    		player.outputChatBox("Weapon: "+args[2]+" of unit Heavy");} else player.outputChatBox("Use /weapon 5 [0-5]");break;}
    		case 6:{if (args[2]>=0 && args[2]<=7){player.giveWeapon(weapon.Thorow[args[2]],1000);
    		player.outputChatBox("Weapon: "+args[2]+" of unit Thorow");} else player.outputChatBox("Use /weapon 6 [0-7]");break;}
    		default:
    		player.outputChatBox("Use /weapon 0-6 [id]");
    		break;
    		}
    	},

    Сам файл: weapon.js

    Скачать: https://drive.google.com/open?id=0B__EFpIDYcQ6ZEc0akc1S0JFcEE

    Если возникнут проблемы обращайтесь! 

×
×
  • Create New...