
![[TUT] Делаем отдельную модель VIP игроку [TUT] Делаем отдельную модель VIP игроку](https://zombie-mod.com/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![[TUT] Делаем отдельную модель VIP игроку [TUT] Делаем отдельную модель VIP игроку](https://zombie-mod.com/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
Для того, чтобы сделать отдельную модель VIP игроку делайте всё, как я.
Итак, начнём.
Для начала скачаем плагин:
Просто установкой плагина вы ничего не измените т.к. в вашем исходнике мода, нету кое-какой функции.
Добавлением этой функции мы сейчас и займёмся.
1.Открываем исходник вашего мода, и ищем
public plugin_natives()
После строки
register_native("zp_force_buy_extra_item", "native_force_buy_extra_item", 1)
Добавляем
register_native("zp_override_user_model", "native_override_user_model", 1)
Должно получиться так:
Шаг №2. Ищем
// Native: zp_force_buy_extra_item
public native_force_buy_extra_item(id, itemid, ignorecost)
{
// ZP disabled
if (!g_pluginenabled)
return -1;
if (itemid < 0 || itemid >= g_extraitem_i)
return 0;
buy_extra_item(id, itemid, ignorecost)
return 1;
}
И чуток ниже добавляем данный код:
// Native: zp_override_user_model
public native_override_user_model(id, const newmodel[], modelindex)
{
// ZP disabled
if (!g_pluginenabled)
return false;
if (!is_user_valid_connected(id))
{
log_error(AMX_ERR_NATIVE, "[%s] Invalid Player (%d)", ZP_PREFIX, id)
return false;
}
// Strings passed byref
param_convert(2)
// Remove previous tasks
remove_task(id+TASK_MODEL)
// Custom models stuff
static currentmodel[32]
if (g_handle_models_on_separate_ent)
{
// Set the right model
copy(g_playermodel[id], charsmax(g_playermodel[]), newmodel)
if (g_set_modelindex_offset && modelindex) fm_cs_set_user_model_index(id, modelindex)
// Set model on player model entity
fm_set_playermodel_ent(id)
}
else
{
// Get current model for comparing it with the current one
fm_cs_get_user_model(id, currentmodel, charsmax(currentmodel))
// Set the right model, after checking that we don't already have it
if (!equal(currentmodel, newmodel))
{
copy(g_playermodel[id], charsmax(g_playermodel[]), newmodel)
if (g_set_modelindex_offset && modelindex) fm_cs_set_user_model_index(id, modelindex)
// An additional delay is offset at round start
// since SVC_BAD is more likely to be triggered there
if (g_newround)
set_task(5.0 * g_modelchange_delay, "fm_user_model_update", id+TASK_MODEL)
else
fm_user_model_update(id+TASK_MODEL)
}
}
return true;
}
Должно получиться так
Шаг №3. Идём в scripting/include и находим файлик zombieplague.inc
В конце или в начале вписываем:
/**
* Overrides ZP player model with a different custom model.
*
* Note: This will last until player's next infection/humanization/respawn.
*
* Note: Don't call more often than absolutely needed.
*
* @param id Player index.
* @param newmodel Model name.
* @param modelindex Modelindex (optional).
*/
native zp_override_user_model(id, const newmodel[], modelindex = 0)
После этого компилируем оба плагина, и устанавливаем их
На этом всё.
Ах да, самое главное чуть не забыл.
1.Данный плагин работает только в связке с VIP системой by aarnaas
2.Флаг (vips.ini) по которому доступна моделька – e