Half-Life и Adrenaline Gamer форум
http://aghl.ru/forum/

HL Player Models API 1.0
http://aghl.ru/forum/viewtopic.php?f=19&t=2963
Страница 1 из 1

Автор:  rtxa [ 12 мар 2019, 21:26 ]
Заголовок сообщения:  HL Player Models API 1.0

HL Player Models API

Author: rtxa | Version: 1.0

This API for Half-Life was made with the aim in mind to be able to use differents models in Teamplay mode. Now with this you can add classes for Zombie Mod, etc.

Introduction

This let you set custom models to the players and reset them to the default model. The custom model will stay until the player disconnects or you reset it manually.

Functions

Код:
/**
 * Sets a custom player model.
 *
 * @param id      Player index
 * @param model   Model short-name
 */
native hl_set_player_model(id, const model[])

/**
 * Restores default model of player.
 *
 * @param id    Player index
 */
native hl_reset_player_model(id)

/**
 * Returns the team id of the player, and optionally retrieves the name of
 * the team.
 *
 * @param id            Player index
 * @param team          Buffer to store team name
 * @param len           Maximum buffer length
 */
native hl_get_player_team(id, team[] = , len = )

/**
 * Sets the player's team without killing him.
 *
 * @param id        Player index
 * @param teamid    Team id
 */
native hl_set_player_team(id, teamid)

Requirements

  • AMX Mod X 1.9.0 Build 5208 or newer.
  • Fakemeta.
  • Hamsandwich.

Installation

  1. Download the attached files and extract them in your scripting folder, then type #include <hl_player_models_api> in your plugin to be able to use the functions.
  2. Compile hl_player_models_api.sma and add it to your plugin list in plugins.ini to turn on the API.

Notes

  • Any custom model that is going to be set to the player has to be previously precached.
  • Any plugin that use functions for get and set player team, must use the functions from this API to work correctly.
  • Bots that identify player’s team according by his model will not work correctly, modify them to use m_szTeamName instead.
  • You can’t get model key from players with custom models using get_user_info(id, “model”, …), instead you should get it from pev_modelindex o pev_model.

Sample plugin

I leave you this sample plugin called “Skin Menu”, what it does is open a menu to the player where he can choose choose a custom model (contains all default player models that comes with Half-Life).

Вложения:
Скачать плагин или Скачать исходник [hl_player_models_api.sma - 6.41 КБ]
Скачиваний: 465
hl_player_models_api.inc [2.25 КБ]
Скачиваний: 468
Скачать плагин или Скачать исходник [skin_menu.sma - 1008 байт]
Скачиваний: 498

Автор:  Valve [ 20 ноя 2020, 09:17 ]
Заголовок сообщения:  Re: HL Player Models API 1.0

Поставил себе на сервер ( Zombie Mod X ) эти плагины. Проверяю командой amx_plugins, всё работает, плагины запущены. Но на сервере ни каких изменений. Ни какого меню с выбором моделей не наблюдается. Плагины и для HLDS и ReHLDS ? Или только для ReHLDS ?

Автор:  Safety1st [ 27 ноя 2020, 02:17 ]
Заголовок сообщения:  Re: HL Player Models API 1.0

amxx cmds покажи.

Автор:  Valve [ 28 ноя 2020, 18:09 ]
Заголовок сообщения:  Re: HL Player Models API 1.0

Цитата:
amxx cmds покажи.
Палево конечно, показывать плагины сервера, ну да ладно. Ради идеи можно
 

Автор:  rtxa [ 02 дек 2020, 08:36 ]
Заголовок сообщения:  Re: HL Player Models API 1.0

Sadly I don't enter too much to the forum so you don't see me answer these questions in time.

Valve, you need to install the sample plugin "Skin Menu" along with HL Players Model API to work.

Автор:  Valve [ 03 дек 2020, 12:01 ]
Заголовок сообщения:  Re: HL Player Models API 1.0

rtxa
Hello, thank you for answering. I did so and installed it right away ( skin_menu, hl_player_models_api. inc and hl_player_models_api).

Автор:  rtxa [ 08 дек 2020, 06:33 ]
Заголовок сообщения:  Re: HL Player Models API 1.0

So I guess it worked, you can find last version in AlliedModders with support for ReHLDS in case you're using it.

Страница 1 из 1 Часовой пояс: UTC + 5 часов [ Летнее время ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/