Player entity size

Сообщения
29
Реакции
4
Помог
1 раз(а)
Ошибка
None.
ОС
Windows
Amx Mod X
AMX Mod X 1.9.0.5232 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Oct 14 2018 08:48:04
Built from: https://github.com/alliedmodders/amxmodx/commit/be526418
Build ID: 5232:be526418
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
Exe build: 16:10:54 Aug 10 2018 (7960)
ReGamedll
ReGameDLL version: 5.7.0.313-dev
Build date: 08:39:22 Sep 9 2018
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/e924a26
Версия Metamod
Metamod v1.21-am  2013-03-15 (5:13)
by Will Day <[email protected]>
http://www.metamod.org/
compiled: Mar 15 2013, 15:20:21 (msc optimized)
Список метамодулей
Currently loaded plugins:
description stat pend file vers src load unlod
[ 1] AMX Mod X RUN - amxmodx_mm.dll v1.9.0.5 ini Start ANY
[ 2] Ham Sandwich RUN - hamsandwich_amxx v1.9.0.5 pl1 ANY ANY
[ 3] CSX RUN - csx_amxx.dll v1.9.0.5 pl1 ANY ANY
[ 4] ReAPI RUN - reapi_amxx.dll v5.6.0.1 pl1 ANY Never
[ 5] FakeMeta RUN - fakemeta_amxx.dl v1.9.0.5 pl1 ANY ANY
5 plugins, 5 running
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] Admin Base 1.9.0.5232 AMXX Dev Team admin.amxx running
[ 2] Admin Commands 1.9.0.5232 AMXX Dev Team admincmd.amxx running
[ 3] Admin Help 1.9.0.5232 AMXX Dev Team adminhelp.amxx running
[ 4] Slots Reservation 1.9.0.5232 AMXX Dev Team adminslots.amxx running
[ 5] Multi-Lingual System 1.9.0.5232 AMXX Dev Team multilingual.am running
[ 6] Menus Front-End 1.9.0.5232 AMXX Dev Team menufront.amxx running
[ 7] Commands Menu 1.9.0.5232 AMXX Dev Team cmdmenu.amxx running
[ 8] Players Menu 1.9.0.5232 AMXX Dev Team plmenu.amxx running
[ 9] Maps Menu 1.9.0.5232 AMXX Dev Team mapsmenu.amxx running
[ 10] Plugin Menu 1.9.0.5232 AMXX Dev Team pluginmenu.amxx running
[ 11] Admin Chat 1.9.0.5232 AMXX Dev Team adminchat.amxx running
[ 12] Anti Flood 1.9.0.5232 AMXX Dev Team antiflood.amxx running
[ 13] Scrolling Message 1.9.0.5232 AMXX Dev Team scrollmsg.amxx running
[ 14] Info. Messages 1.9.0.5232 AMXX Dev Team imessage.amxx running
[ 15] Admin Votes 1.9.0.5232 AMXX Dev Team adminvote.amxx running
[ 16] NextMap 1.9.0.5232 AMXX Dev Team nextmap.amxx running
[ 17] Nextmap Chooser 1.9.0.5232 AMXX Dev Team mapchooser.amxx running
[ 18] TimeLeft 1.9.0.5232 AMXX Dev Team timeleft.amxx running
[ 19] Pause Plugins 1.9.0.5232 AMXX Dev Team pausecfg.amxx running
[ 20] Stats Configuration 1.9.0.5232 AMXX Dev Team statscfg.amxx running
[ 21] StatsX 1.9.0.5232 AMXX Dev Team statsx.amxx running
[ 22] [AMXX] Settings API 1.0 MeRcyLeZZ amx_settings_ap debug
[ 23] AvP2 Alien Classe (Fac v1.0.2 Crazy avp_class_faceh debug
23 plugins, 23 running
Автор плагина
Crazy
Версия плагина
v1.0.2
Исходный код
#include <amxmodx>
#include <reapi>
#include <fakemeta>
#include <amx_settings_api>
#include <avp_version>

#define SetPlayerBit(%1,%2) (%1 |= (1<<(%2&31)))
#define ClearPlayerBit(%1,%2) (%1 &= ~(1 <<(%2&31)))
#define CheckPlayerBit(%1,%2) (%1 & (1<<(%2&31)))

new const AVP_SETTINGS_FILE[] = "aliens_vs_predator.ini";

new g_fIsFacehugger;
new Array:g_arrPlayerModels;
new Float:g_flGravity = 1.0;
new Float:g_flSpeed = 240.0;

public plugin_init()
{
register_plugin("AvP2 Alien Classe (Facehugger)", AVP_VERSION_STR, "Crazy");

register_clcmd("say /hugg", "CmdFacehugger");
register_clcmd("say /b_hugg", "CmdBotFacehugger");

RegisterHookChain(RG_CBasePlayer_ResetMaxSpeed, "CBasePlayer_ResetMaxSpeed_Post", 1);
//register_forward(FM_SetSize, "pfnSetSize");
}

public plugin_precache()
{
g_arrPlayerModels = ArrayCreate(32, 1);

amx_load_setting_string_arr(AVP_SETTINGS_FILE, "Facehugger", "Model", g_arrPlayerModels);

if (ArraySize(g_arrPlayerModels) == 0)
{
ArrayPushString(g_arrPlayerModels, "avp2_facehugger");
amx_save_setting_string_arr(AVP_SETTINGS_FILE, "Facehugger", "Model", g_arrPlayerModels);
}

if (!amx_load_setting_float(AVP_SETTINGS_FILE, "Facehugger", "Gravity", g_flGravity))
amx_save_setting_float(AVP_SETTINGS_FILE, "Facehugger", "Gravity", g_flGravity);

if (!amx_load_setting_float(AVP_SETTINGS_FILE, "Facehugger", "Speed", g_flSpeed))
amx_save_setting_float(AVP_SETTINGS_FILE, "Facehugger", "Speed", g_flSpeed);

PreacheModelArray(g_arrPlayerModels);
}

public client_remove(this)
{
ClearPlayerBit(g_fIsFacehugger, this);
}

public CmdFacehugger(this)
{
CFacehugger_Spawn(this);
}

public CmdBotFacehugger(this)
{
new rgpPlayers[MAX_PLAYERS], iPlayersCount, pPlayer;

get_players(rgpPlayers, iPlayersCount, "ad");

while ((pPlayer = rgpPlayers[random(iPlayersCount)]) && CheckPlayerBit(g_fIsFacehugger, pPlayer)) { /* keep looking */ }

CFacehugger_Spawn(pPlayer);
}

public CBasePlayer_ResetMaxSpeed_Post(this)
{
if (CheckPlayerBit(g_fIsFacehugger, this))
set_entvar(this, var_maxspeed, g_flSpeed);
}

public pfnSetSize(this, const Float:vecMins[3], const Float:vecMaxs[3])
{
if (!is_user_alive(this))
return FMRES_IGNORED;

if (!CheckPlayerBit(g_fIsFacehugger, this))
return FMRES_IGNORED;

//if (vecMins[0] == -16.0 &&)
client_print(this, print_chat, "mins [0]=%.1f [1]=%.1f [2]=%.1f", vecMins[0], vecMins[1], vecMins[2]);
client_print(this, print_chat, "maxs [0]=%.1f [1]=%.1f [2]=%.1f", vecMaxs[0], vecMaxs[1], vecMaxs[2])
return FMRES_IGNORED;
}

/*#define VEC_DUCK_HULL_MIN Vector(-16, -16, -18)
#define VEC_DUCK_HULL_MAX Vector(16, 16, 32)

#define VEC_HULL_MIN Vector(-16, -16, -36)
#define VEC_HULL_MAX Vector(16, 16, 36)*/

CFacehugger_Spawn(this)
{
SetPlayerBit(g_fIsFacehugger, this);

new Float:oldMins[3], Float:newMins[3];

get_entvar(this, var_mins, oldMins);

new szModelName[32];

ArrayGetString(g_arrPlayerModels, random(ArraySize(g_arrPlayerModels)), szModelName, charsmax(szModelName));

rg_set_user_model(this, szModelName, true);
engfunc(EngFunc_SetSize, this, Float:{-12.0, -12.0, -0.0}, Float:{12.0, 12.0, 24.0});
set_entvar(this, var_gravity, Float:g_flGravity);

get_entvar(this, var_mins, newMins);

client_print(0, print_chat, "oldmins %.2f newmins %.2f", oldMins[0], newMins[0]);

rg_reset_maxspeed(this);
}

PreacheModelArray(Array:arrHandle)
{
new i, szModelName[32], szModelPath[64];

new iModelsCount = ArraySize(arrHandle);

for (i = 0; i < iModelsCount; i++)
{
ArrayGetString(arrHandle, i, szModelName, charsmax(szModelName));

formatex(szModelPath, charsmax(szModelPath), "models/player/%s/%s.mdl", szModelName, szModelName);
precache_model(szModelPath);

formatex(szModelPath, charsmax(szModelPath), "models/player/%s/%sT.mdl", szModelName, szModelName);
if (file_exists(szModelPath)) precache_model(szModelPath);
}
}
Hello, I'm trying to set player entity size (pfnSetSize). It looks set the custom size but it doesn't work. I mean, in game it looks same as default but if I debug it output the custom size I set. Any idea how I can properly do that?
 

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу