diff --git a/addons/sourcemod/scripting/include/vehicles.inc b/addons/sourcemod/scripting/include/vehicles.inc index 4ad6d2d..355ba7c 100644 --- a/addons/sourcemod/scripting/include/vehicles.inc +++ b/addons/sourcemod/scripting/include/vehicles.inc @@ -28,20 +28,20 @@ methodmap Vehicle } /** - * The entity index. + * Creates and spawns a new vehicle matching the given identifier. + * + * @param id Identifier of the vehicle, as defined in the configuration. + * @param origin Origin to spawn vehicle at. + * @param angles Angles to spawn vehicle at. + * @param owner Owner entity of this vehicle. + * @return Entity index of the vehicle. */ - property int Entity - { - public get() - { - return view_as<int>(this); - } - } + public static native int Create(const char[] id, const float origin[3], const float angles[3], int owner = 0); /** * The owner entity of this vehicle. * - * @note You should use this property over m_hOwnerEntity if you want the owner to collide with the vehicle. + * This property is an alternative to m_hOwnerEntity that still allows the owner to collide with the vehicle. */ property int Owner { @@ -50,50 +50,55 @@ methodmap Vehicle } /** - * Creates a new vehicle and spawns it. + * Retrieves the identifier of this vehicle. * - * @param id The identifier of the vehicle to spawn, as defined in the configuration. - * @param origin Origin to spawn vehicle at. - * @param angles Angles to spawn vehicle at. - * @param owner The owner entity of this vehicle. + * The identifier is retrieved from the vehicle configuration using the vehicle model and the vehicle script. * - * @return Entity index of the vehicle. + * @param buffer Buffer to store the identifier in. + * @param maxlength Maximum size of the buffer. + * @return True on success, false on failure. */ - public static native int Create(const char[] id, const float origin[3], const float angles[3], int owner = 0); + public native bool GetId(char[] buffer, int maxlength); /** * Forces a client into this vehicle. * - * @param Client index. + * @param client Client index. */ public native void ForcePlayerIn(int client); /** - * Forces the driver out of this vehicle. + * Forces the current driver out of this vehicle. */ public native void ForcePlayerOut(); } /** - * Called when a vehicle entity has been spawned and fully initialized. - * - * @note It is safe to remove the entity in this forward. + * Called when a vehicle entity has spawned. * - * @param vehicle The vehicle entity. - * @error Invalid vehicle index. + * @param vehicle The vehicle entity. */ forward void OnVehicleSpawned(int vehicle); /** - * Called when a vehicle entity is destroyed. + * Called when a vehicle entity is being destroyed. * - * @note You should implement this forward over OnEntityDestroyed if you need to access the vehicle's properties. + * The vehicle properties can still be accessed in this forward. * - * @param vehicle The vehicle entity. - * @error Invalid vehicle index. + * @param vehicle The vehicle entity. */ forward void OnVehicleDestroyed(int vehicle); +/** + * Retrieves the name of the vehicle with the given identifier. + * + * @param id Identifier of the vehicle, as defined in the configuration. + * @param buffer Buffer to store the name in. + * @param maxlength Maximum size of the buffer. + * @return True on success, false on failure. + */ +native bool GetVehicleName(const char[] id, char[] buffer, int maxlength); + public SharedPlugin __pl_vehicles = { name = "vehicles", @@ -108,10 +113,12 @@ public SharedPlugin __pl_vehicles = #if !defined REQUIRE_PLUGIN public __pl_vehicles_SetNTVOptional() { + MarkNativeAsOptional("Vehicle.Create"); MarkNativeAsOptional("Vehicle.Owner.get"); MarkNativeAsOptional("Vehicle.Owner.set"); - MarkNativeAsOptional("Vehicle.Create"); + MarkNativeAsOptional("Vehicle.GetId"); MarkNativeAsOptional("Vehicle.ForcePlayerIn"); MarkNativeAsOptional("Vehicle.ForcePlayerOut"); + MarkNativeAsOptional("GetVehicleName"); } #endif diff --git a/addons/sourcemod/scripting/vehicles.sp b/addons/sourcemod/scripting/vehicles.sp index 933c1a0..9d143dd 100644 --- a/addons/sourcemod/scripting/vehicles.sp +++ b/addons/sourcemod/scripting/vehicles.sp @@ -16,8 +16,9 @@ */ #include <sourcemod> -#include <dhooks> #include <sdkhooks> +#include <adminmenu> +#include <dhooks> #undef REQUIRE_EXTENSIONS #tryinclude <loadsoundscript> @@ -26,7 +27,7 @@ #pragma semicolon 1 #pragma newdecls required -#define PLUGIN_VERSION "2.2.0" +#define PLUGIN_VERSION "2.3.0" #define PLUGIN_AUTHOR "Mikusch" #define PLUGIN_URL "https://github.com/Mikusch/source-vehicles" @@ -207,11 +208,6 @@ enum struct VehicleProperties { int entity; int owner; - - void Initialize(int entity) - { - this.entity = entity; - } } methodmap Vehicle @@ -226,7 +222,7 @@ methodmap Vehicle if (g_VehicleProperties.FindValue(entity, VehicleProperties::entity) == -1) { VehicleProperties properties; - properties.Initialize(entity); + properties.entity = entity; g_VehicleProperties.PushArray(properties); } @@ -280,20 +276,18 @@ public void OnPluginStart() //Create plugin convars vehicle_config_path = CreateConVar("vehicle_config_path", "configs/vehicles/vehicles.cfg", "Path to vehicle configuration file, relative to the SourceMod folder"); - vehicle_config_path.AddChangeHook(ConVarChanged_RefreshVehicleConfig); + vehicle_config_path.AddChangeHook(ConVarChanged_ReloadVehicleConfig); vehicle_physics_damage_modifier = CreateConVar("vehicle_physics_damage_modifier", "1.0", "Modifier of impact-based physics damage against other players", _, true, 0.0); vehicle_passenger_damage_modifier = CreateConVar("vehicle_passenger_damage_modifier", "1.0", "Modifier of damage dealt to vehicle passengers", _, true, 0.0); vehicle_enable_entry_exit_anims = CreateConVar("vehicle_enable_entry_exit_anims", "0", "If set to 1, enables entry and exit animations (experimental)"); vehicle_enable_horns = CreateConVar("vehicle_enable_horns", "1", "If set to 1, enables vehicle horns"); - RegAdminCmd("sm_vehicle", ConCmd_OpenVehicleMenu, ADMFLAG_GENERIC); - RegAdminCmd("sm_vehicles", ConCmd_OpenVehicleMenu, ADMFLAG_GENERIC); - RegAdminCmd("sm_createvehicle", ConCmd_CreateVehicle, ADMFLAG_GENERIC); - RegAdminCmd("sm_spawnvehicle", ConCmd_CreateVehicle, ADMFLAG_GENERIC); - RegAdminCmd("sm_destroyvehicle", ConCmd_DestroyVehicle, ADMFLAG_GENERIC); - RegAdminCmd("sm_removevehicle", ConCmd_DestroyVehicle, ADMFLAG_GENERIC); - RegAdminCmd("sm_destroyallvehicles", ConCmd_DestroyAllVehicles, ADMFLAG_GENERIC); - RegAdminCmd("sm_removeallvehicles", ConCmd_DestroyAllVehicles, ADMFLAG_GENERIC); + RegAdminCmd("sm_vehicle", ConCmd_OpenVehicleMenu, ADMFLAG_GENERIC, "Open vehicle menu"); + RegAdminCmd("sm_vehicle_create", ConCmd_CreateVehicle, ADMFLAG_GENERIC, "Create new vehicle"); + RegAdminCmd("sm_vehicle_remove", ConCmd_RemovePlayerVehicles, ADMFLAG_GENERIC, "Remove player vehicles"); + RegAdminCmd("sm_vehicle_removeaim", ConCmd_RemoveAimTargetVehicle, ADMFLAG_GENERIC, "Remove vehicle at crosshair"); + RegAdminCmd("sm_vehicle_removeall", ConCmd_RemoveAllVehicles, ADMFLAG_GENERIC, "Remove all vehicles"); + RegAdminCmd("sm_vehicle_reload", ConCmd_ReloadVehicleConfig, ADMFLAG_GENERIC, "Reload vehicle configuration"); AddCommandListener(CommandListener_VoiceMenu, "voicemenu"); @@ -345,11 +339,13 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max { RegPluginLibrary("vehicles"); + CreateNative("Vehicle.Create", NativeCall_VehicleCreate); CreateNative("Vehicle.Owner.get", NativeCall_VehicleOwnerGet); CreateNative("Vehicle.Owner.set", NativeCall_VehicleOwnerSet); - CreateNative("Vehicle.Create", NativeCall_VehicleCreate); + CreateNative("Vehicle.GetId", NativeCall_VehicleGetId); CreateNative("Vehicle.ForcePlayerIn", NativeCall_VehicleForcePlayerIn); CreateNative("Vehicle.ForcePlayerOut", NativeCall_VehicleForcePlayerOut); + CreateNative("GetVehicleName", NativeCall_GetVehicleName); g_ForwardOnVehicleSpawned = new GlobalForward("OnVehicleSpawned", ET_Ignore, Param_Cell); g_ForwardOnVehicleDestroyed = new GlobalForward("OnVehicleDestroyed", ET_Ignore, Param_Cell); @@ -560,6 +556,11 @@ void V_swap(int &x, int &y) y = temp; } +bool IsEntityClient(int client) +{ + return 0 < client <= MaxClients; +} + bool IsEntityVehicle(int entity) { char classname[32]; @@ -719,7 +720,7 @@ void RestoreConVar(const char[] name, const char[] oldValue) // ConVars //----------------------------------------------------------------------------- -public void ConVarChanged_RefreshVehicleConfig(ConVar convar, const char[] oldValue, const char[] newValue) +public void ConVarChanged_ReloadVehicleConfig(ConVar convar, const char[] oldValue, const char[] newValue) { ReadVehicleConfig(); } @@ -728,27 +729,6 @@ public void ConVarChanged_RefreshVehicleConfig(ConVar convar, const char[] oldVa // Natives //----------------------------------------------------------------------------- -public int NativeCall_VehicleOwnerGet(Handle plugin, int numParams) -{ - int vehicle = GetNativeCell(1); - - if (!IsEntityVehicle(vehicle)) - ThrowNativeError(SP_ERROR_NATIVE, "Entity %d is not a vehicle", vehicle); - - return Vehicle(vehicle).Owner; -} - -public int NativeCall_VehicleOwnerSet(Handle plugin, int numParams) -{ - int vehicle = GetNativeCell(1); - int owner = GetNativeCell(2); - - if (!IsEntityVehicle(vehicle)) - ThrowNativeError(SP_ERROR_NATIVE, "Entity %d is not a vehicle", vehicle); - - return Vehicle(vehicle).Owner = owner; -} - public int NativeCall_VehicleCreate(Handle plugin, int numParams) { VehicleConfig config; @@ -777,6 +757,44 @@ public int NativeCall_VehicleCreate(Handle plugin, int numParams) } } +public int NativeCall_VehicleOwnerGet(Handle plugin, int numParams) +{ + int vehicle = GetNativeCell(1); + + if (!IsEntityVehicle(vehicle)) + ThrowNativeError(SP_ERROR_NATIVE, "Entity %d is not a vehicle", vehicle); + + return Vehicle(vehicle).Owner; +} + +public int NativeCall_VehicleOwnerSet(Handle plugin, int numParams) +{ + int vehicle = GetNativeCell(1); + int owner = GetNativeCell(2); + + if (!IsEntityVehicle(vehicle)) + ThrowNativeError(SP_ERROR_NATIVE, "Entity %d is not a vehicle", vehicle); + + return Vehicle(vehicle).Owner = owner; +} + +public int NativeCall_VehicleGetId(Handle plugin, int numParams) +{ + int vehicle = GetNativeCell(1); + int maxlength = GetNativeCell(3); + + if (!IsEntityVehicle(vehicle)) + ThrowNativeError(SP_ERROR_NATIVE, "Entity %d is not a vehicle", vehicle); + + VehicleConfig config; + if (GetConfigByVehicleEnt(vehicle, config)) + { + return SetNativeString(2, config.id, maxlength) == SP_ERROR_NONE; + } + + return false; +} + public int NativeCall_VehicleForcePlayerIn(Handle plugin, int numParams) { int vehicle = GetNativeCell(1); @@ -785,7 +803,7 @@ public int NativeCall_VehicleForcePlayerIn(Handle plugin, int numParams) if (!IsEntityVehicle(vehicle)) ThrowNativeError(SP_ERROR_NATIVE, "Entity %d is not a vehicle", vehicle); - if (client < 1 || client > MaxClients) + if (!IsEntityClient(client)) ThrowNativeError(SP_ERROR_NATIVE, "Invalid client index %d", client); if (!IsClientInGame(client)) @@ -809,6 +827,23 @@ public int NativeCall_VehicleForcePlayerOut(Handle plugin, int numParams) SDKCall_HandlePassengerExit(GetServerVehicle(vehicle), client); } +public int NativeCall_GetVehicleName(Handle plugin, int numParams) +{ + VehicleConfig config; + + char id[256]; + if (GetNativeString(1, id, sizeof(id)) == SP_ERROR_NONE && GetConfigById(id, config)) + { + int maxlength = GetNativeCell(3); + int bytes; + return SetNativeString(2, config.name, maxlength, _, bytes) == SP_ERROR_NONE && bytes > 0; + } + else + { + return ThrowNativeError(SP_ERROR_NATIVE, "Invalid or unknown vehicle: %s", id); + } +} + //----------------------------------------------------------------------------- // Forwards //----------------------------------------------------------------------------- @@ -906,30 +941,81 @@ public Action ConCmd_CreateVehicle(int client, int args) return Plugin_Handled; } -public Action ConCmd_DestroyVehicle(int client, int args) +public Action ConCmd_RemovePlayerVehicles(int client, int args) { - if (client == 0) + if (args < 1) { - ReplyToCommand(client, "%t", "Command is in-game only"); + ReplyToCommand(client, "[SM] Usage: sm_vehicle_remove <#userid|name>"); return Plugin_Handled; } - int entity = GetClientAimTarget(client, false); + char arg[MAX_TARGET_LENGTH]; + GetCmdArg(1, arg, sizeof(arg)); - if (IsEntityVehicle(entity)) + char target_name[MAX_TARGET_LENGTH]; + int target_list[MAXPLAYERS], target_count; + bool tn_is_ml; + + if ((target_count = ProcessTargetString(arg, client, target_list, MaxClients + 1, COMMAND_TARGET_NONE, target_name, sizeof(target_name), tn_is_ml)) <= 0) { - RemoveEntity(entity); - ReplyToCommand(client, "%t", "#Command_DestroyVehicle_Success"); + ReplyToTargetError(client, target_count); + return Plugin_Handled; + } + + int vehicle = MaxClients + 1; + while ((vehicle = FindEntityByClassname(vehicle, VEHICLE_CLASSNAME)) != -1) + { + int owner = Vehicle(vehicle).Owner; + if (!IsEntityClient(owner)) + continue; + + for (int i = 0; i < target_count; i++) + { + int target = target_list[i]; + if (owner == target) + RemoveEntity(vehicle); + } + } + + if (tn_is_ml) + { + ShowActivity2(client, "[SM] ", "%t", "#Command_RemovePlayerVehicles_Success", target_name); } else { - ReplyToCommand(client, "%t", "#Command_DestroyVehicle_NoVehicleFound"); + ShowActivity2(client, "[SM] ", "%t", "#Command_RemovePlayerVehicles_Success", "_s", target_name); } return Plugin_Handled; } -public Action ConCmd_DestroyAllVehicles(int client, int args) +public Action ConCmd_RemoveAimTargetVehicle(int client, int args) +{ + if (client == 0) + { + ReplyToCommand(client, "%t", "Command is in-game only"); + return Plugin_Handled; + } + + int entity = GetClientAimTarget(client, false); + if (IsEntityVehicle(entity)) + { + int owner = Vehicle(entity).Owner; + if (!IsEntityClient(owner) || CanUserTarget(client, owner)) + { + RemoveEntity(entity); + ShowActivity2(client, "[SM] ", "%t", "#Command_RemoveVehicle_Success"); + } + else + { + ReplyToCommand(client, "%t", "Unable to target"); + } + } + + return Plugin_Handled; +} + +public Action ConCmd_RemoveAllVehicles(int client, int args) { int vehicle = MaxClients + 1; while ((vehicle = FindEntityByClassname(vehicle, VEHICLE_CLASSNAME)) != -1) @@ -937,7 +1023,15 @@ public Action ConCmd_DestroyAllVehicles(int client, int args) RemoveEntity(vehicle); } - ReplyToCommand(client, "%t", "#Command_DestroyAllVehicles_Success"); + ShowActivity2(client, "[SM] ", "%t", "#Command_RemoveAllVehicles_Success"); + return Plugin_Handled; +} + +public Action ConCmd_ReloadVehicleConfig(int client, int args) +{ + ReadVehicleConfig(); + + ShowActivity2(client, "[SM] ", "%t", "#Command_ReloadVehicleConfig_Success"); return Plugin_Handled; } @@ -1002,7 +1096,7 @@ public Action PropVehicleDriveable_Use(int vehicle, int activator, int caller, U { //Prevent call to ResetUseKey and HandlePassengerEntry for the driving player int driver = GetEntPropEnt(vehicle, Prop_Data, "m_hPlayer"); - if (0 < activator <= MaxClients && driver != -1 && driver == activator) + if (IsEntityClient(activator) && driver != -1 && driver == activator) return Plugin_Handled; return Plugin_Continue; @@ -1069,11 +1163,32 @@ void DisplayMainVehicleMenu(int client) Menu menu = new Menu(MenuHandler_MainVehicleMenu, MenuAction_Select | MenuAction_DisplayItem | MenuAction_End); menu.SetTitle("%t", "#Menu_Title_Main", PLUGIN_VERSION, PLUGIN_AUTHOR, PLUGIN_URL); - menu.AddItem("vehicle_create", "#Menu_Item_CreateVehicle"); - menu.AddItem("vehicle_destroy", "#Menu_Item_DestroyVehicle"); - menu.AddItem("vehicle_destroyall", "#Menu_Item_DestroyAllVehicles"); + if (CheckCommandAccess(client, "sm_vehicle_create", ADMFLAG_GENERIC)) + menu.AddItem("vehicle_create", "#Menu_Item_CreateVehicle"); + + if (CheckCommandAccess(client, "sm_vehicle_removeaim", ADMFLAG_GENERIC)) + menu.AddItem("vehicle_removeaim", "#Menu_Item_RemoveAimTargetVehicle"); + + if (CheckCommandAccess(client, "sm_vehicle_remove", ADMFLAG_GENERIC)) + menu.AddItem("vehicle_remove", "#Menu_Item_RemovePlayerVehicles"); + + if (CheckCommandAccess(client, "sm_vehicle_removeall", ADMFLAG_GENERIC)) + menu.AddItem("vehicle_removeall", "#Menu_Item_RemoveAllVehicles"); + + if (CheckCommandAccess(client, "sm_vehicle_reload", ADMFLAG_GENERIC)) + menu.AddItem("vehicle_reload", "#Menu_Item_ReloadVehicleConfig"); + + menu.Display(client, MENU_TIME_FOREVER); +} + +void DisplayRemoveVehicleTargetMenu(int client) +{ + Menu menu = new Menu(MenuHandler_RemoveVehicles, MenuAction_Select | MenuAction_End); + menu.SetTitle("%t", "#Menu_Title_RemovePlayerVehicles"); + menu.ExitBackButton = true; + + AddTargetsToMenu(menu, client); - menu.ExitButton = true; menu.Display(client, MENU_TIME_FOREVER); } @@ -1090,14 +1205,23 @@ public int MenuHandler_MainVehicleMenu(Menu menu, MenuAction action, int param1, { DisplayVehicleCreateMenu(param1); } - else if (StrEqual(info, "vehicle_destroy")) + else if (StrEqual(info, "vehicle_removeaim")) { - FakeClientCommand(param1, "sm_destroyvehicle"); + FakeClientCommand(param1, "sm_vehicle_removeaim"); DisplayMainVehicleMenu(param1); } - else if (StrEqual(info, "vehicle_destroyall")) + else if (StrEqual(info, "vehicle_remove")) + { + DisplayRemoveVehicleTargetMenu(param1); + } + else if (StrEqual(info, "vehicle_removeall")) { - FakeClientCommand(param1, "sm_destroyallvehicles"); + FakeClientCommand(param1, "sm_vehicle_removeall"); + DisplayMainVehicleMenu(param1); + } + else if (StrEqual(info, "vehicle_reload")) + { + FakeClientCommand(param1, "sm_vehicle_reload"); DisplayMainVehicleMenu(param1); } } @@ -1125,6 +1249,7 @@ void DisplayVehicleCreateMenu(int client) { Menu menu = new Menu(MenuHandler_VehicleCreateMenu, MenuAction_Select | MenuAction_DisplayItem | MenuAction_Cancel | MenuAction_End); menu.SetTitle("%t", "#Menu_Title_CreateVehicle"); + menu.ExitBackButton = true; for (int i = 0; i < g_AllVehicles.Length; i++) { @@ -1135,8 +1260,6 @@ void DisplayVehicleCreateMenu(int client) } } - menu.ExitButton = true; - menu.ExitBackButton = true; menu.Display(client, MENU_TIME_FOREVER); } @@ -1149,7 +1272,7 @@ public int MenuHandler_VehicleCreateMenu(Menu menu, MenuAction action, int param char info[32]; if (menu.GetItem(param2, info, sizeof(info))) { - FakeClientCommand(param1, "sm_createvehicle %s", info); + FakeClientCommand(param1, "sm_vehicle_create %s", info); DisplayVehicleCreateMenu(param1); } } @@ -1180,6 +1303,47 @@ public int MenuHandler_VehicleCreateMenu(Menu menu, MenuAction action, int param return 0; } +public int MenuHandler_RemoveVehicles(Menu menu, MenuAction action, int param1, int param2) +{ + switch (action) + { + case MenuAction_Cancel: + { + if (param2 == MenuCancel_ExitBack) + { + DisplayMainVehicleMenu(param1); + } + } + case MenuAction_Select: + { + char info[32]; + int userid, target; + + menu.GetItem(param2, info, sizeof(info)); + userid = StringToInt(info); + + if ((target = GetClientOfUserId(userid)) == 0) + { + PrintToChat(param1, "[SM] %t", "Player no longer available"); + } + else if (!CanUserTarget(param1, target)) + { + PrintToChat(param1, "[SM] %t", "Unable to target"); + } + else + { + FakeClientCommand(param1, "sm_vehicle_remove #%d", userid); + } + + DisplayRemoveVehicleTargetMenu(param1); + } + case MenuAction_End: + { + delete menu; + } + } +} + //----------------------------------------------------------------------------- // DHooks //----------------------------------------------------------------------------- diff --git a/addons/sourcemod/translations/ru/vehicles.phrases.txt b/addons/sourcemod/translations/ru/vehicles.phrases.txt index fb4d990..dc4f480 100644 --- a/addons/sourcemod/translations/ru/vehicles.phrases.txt +++ b/addons/sourcemod/translations/ru/vehicles.phrases.txt @@ -1,69 +1,75 @@ "Phrases" { - "#Hint_VehicleKeys_Car" - { - "ru" "%%+speed%% - ГАЗ %%+jump%% - РУЧНОЙ ТОРМОЗ" - } - - "#Hint_VehicleKeys_Airboat" - { - "ru" "%%+forward%% УСКОРЕНИЕ %%+back%% ТОРМОЗ %%+moveleft%% НАЛЕВО %%+moveright%% НАПРАВО" - } - "#Menu_Title_Main" { "#format" "{1:s},{2:s},{3:s}" - "ru" "Добро пожаловать в плагин транспорта {1} от {2}\n{3}" + "ru" "Управляемый Транспорт {1} от {2}\n{3}" } "#Menu_Title_CreateVehicle" { - "ru" "Выберите транспорт для создания" + "ru" "Выберите транспортное средство" } "#Menu_Item_CreateVehicle" { - "ru" "Создать транспорт (!createvehicle)" + "ru" "Создать новое транспортное средств" } - "#Menu_Item_DestroyVehicle" + "#Menu_Item_RemoveAimTargetVehicle" { - "ru" "Удалить транспорт (!removevehicle)" + "ru" "Удалить транспортное средство перед вашим прицелом" } - "#Menu_Item_DestroyAllVehicles" + "#Menu_Item_RemovePlayerVehicles" { - "ru" "Удалить весь созданный транспорт (!removeallvehicles)" + "ru" "Удалить чужие автомобили" + } + + "#Menu_Item_RemoveAllVehicles" + { + "ru" "Удалить все транспортные средства на сервере" } "#Command_CreateVehicle_Invalid" { "#format" "{1:s}" - "ru" "Транспортное средство с названием \"{1}\" не найдено." + "ru" "Транспортное средство с названием '{1}' не найдено." } - "#Command_DestroyVehicle_Success" + "#Command_RemoveVehicle_Success" { - "ru" "Транспортное средство у вашего прицела успешно удалено." + "ru" "Транспортное средство перед вашим прицелом успешно удалено." } - "#Command_DestroyVehicle_NoVehicleFound" + "#Command_RemovePlayerVehicles_Success" { - "ru" "Нет подходящего транспортного средства для удаления." + "#format" "{1:t}" + "ru" "Все транспортные средства {1} успешно удалены." } - "#Command_DestroyAllVehicles_Success" + "#Command_RemoveAllVehicles_Success" { - "ru" "Успешно удалены все транспортные средства с карты." + "ru" "Все транспортные средства на сервере успешно удалены." } "#Vehicle_HL2_Jeep" { - "ru" "Багги Half-Life 2" + "ru" "Багги : Half-Life 2" } "#Vehicle_HL2_Airboat" { - "ru" "Катер на воздушной подушке Half-Life 2" + "ru" "Катер на воздушной подушке : Half-Life 2" + } + + "#Hint_VehicleKeys_Car" + { + "ru" "%%+speed%% - ГАЗ %%+jump%% - РУЧНОЙ ТОРМОЗ" + } + + "#Hint_VehicleKeys_Airboat" + { + "ru" "%%+forward%% УСКОРЕНИЕ %%+back%% ТОРМОЗ %%+moveleft%% НАЛЕВО %%+moveright%% НАПРАВО" } } diff --git a/addons/sourcemod/translations/vehicles.phrases.txt b/addons/sourcemod/translations/vehicles.phrases.txt index e5edf4a..15537f2 100644 --- a/addons/sourcemod/translations/vehicles.phrases.txt +++ b/addons/sourcemod/translations/vehicles.phrases.txt @@ -1,39 +1,44 @@ "Phrases" { - "#Hint_VehicleKeys_Car" + "#Menu_Title_Main" { - "en" "%%+speed%% TURBO %%+jump%% HANDBRAKE" + "#format" "{1:s},{2:s},{3:s}" + "en" "Driveable Vehicles ({1}) by {2}\n{3}" } - "#Hint_VehicleKeys_Airboat" + "#Menu_Title_CreateVehicle" { - "en" "%%+forward%% SPEED UP %%+back%% SLOW DOWN %%+moveleft%% TURN LEFT %%+moveright%% TURN RIGHT" + "en" "Spawn new vehicle:" } - "#Menu_Title_Main" + "#Menu_Title_RemovePlayerVehicles" { - "#format" "{1:s},{2:s},{3:s}" - "en" "Driveable Vehicles ({1}) by {2}\n{3}" + "en" "Remove player vehicles:" } - "#Menu_Title_CreateVehicle" + "#Menu_Item_CreateVehicle" { - "en" "Select a vehicle to spawn" + "en" "Spawn new vehicle" } - "#Menu_Item_CreateVehicle" + "#Menu_Item_RemoveAimTargetVehicle" + { + "en" "Remove vehicle at crosshair" + } + + "#Menu_Item_RemovePlayerVehicles" { - "en" "Spawn vehicle (!createvehicle)" + "en" "Remove player vehicles" } - "#Menu_Item_DestroyVehicle" + "#Menu_Item_RemoveAllVehicles" { - "en" "Remove vehicle (!removevehicle)" + "en" "Remove all vehicles" } - "#Menu_Item_DestroyAllVehicles" + "#Menu_Item_ReloadVehicleConfig" { - "en" "Remove all vehicles (!removeallvehicles)" + "en" "Reload vehicle configuration" } "#Command_CreateVehicle_Invalid" @@ -42,28 +47,44 @@ "en" "Invalid or unknown vehicle: {1}" } - "#Command_DestroyVehicle_Success" + "#Command_RemoveVehicle_Success" { - "en" "Successfully removed the vehicle at your crosshair." + "en" "Removed the vehicle at their crosshair." } - "#Command_DestroyVehicle_NoVehicleFound" + "#Command_RemovePlayerVehicles_Success" { - "en" "Not looking at any valid vehicle to remove." + "#format" "{1:t}" + "en" "Removed all vehicles of {1}." } - "#Command_DestroyAllVehicles_Success" + "#Command_RemoveAllVehicles_Success" { - "en" "Successfully removed all vehicles in the map." + "en" "Removed all vehicles in the world." + } + + "#Command_ReloadVehicleConfig_Success" + { + "en" "Reloaded the vehicle configuration." } "#Vehicle_HL2_Jeep" { - "en" "Half-Life 2 Jeep" + "en" "Half-Life 2 Jeep" } "#Vehicle_HL2_Airboat" { - "en" "Half-Life 2 Airboat" + "en" "Half-Life 2 Airboat" + } + + "#Hint_VehicleKeys_Car" + { + "en" "%%+speed%% TURBO %%+jump%% HANDBRAKE" + } + + "#Hint_VehicleKeys_Airboat" + { + "en" "%%+forward%% SPEED UP %%+back%% SLOW DOWN %%+moveleft%% TURN LEFT %%+moveright%% TURN RIGHT" } }