Hey there!
Recently I got a request from an old friend for a game function that to seek out those deep informations of Podium things.
I've passed him the code and now i want to put it here for those who's also looking for the way to do the same or more.
With this I believe that you are able to improve or create a Podium system with more creativities and functions.
Here is the code and I'd like to check this forum a few days waiting some bug reports.
Good day.
Recently I got a request from an old friend for a game function that to seek out those deep informations of Podium things.
I've passed him the code and now i want to put it here for those who's also looking for the way to do the same or more.
With this I believe that you are able to improve or create a Podium system with more creativities and functions.
Here is the code and I'd like to check this forum a few days waiting some bug reports.
Good day.
Code:
/*
FileName: PodiumHook.core
你可以把本源码放在CCI\.Plugins文件夹中编译
*/
#include <amxx/amxmodx>
#include <amxx/fakemeta>
#include <amxx/engine>
#include <ipci/Ascend>
#include <xtension/Class>
new PodiumEnt, LeftAvatarEnt, RightAvatarEnt, MiddleAvatarEnt, MiddleAvatarNone;
new ClassCount, LeftAvatarClass, RightAvatarClass, MiddleAvatarClass;
new LeftAvatarMID, RightAvatarMID, MiddleAvatarMID;
new AvatarLevel, NextLevelMID, PreLevelMID;
static szAvatarClass[33], szAvatarLevel[33], szAvatarModel[23];
new bool: PodiumVisible[33];
public plugin_init()
{
register_plugin("ESF: ECX Podium Hook", "2.0", "ESFKAMI");
register_forward(FM_AddToFullPack, "fw_AddToFullPack_Post", true);
}
public fw_AddToFullPack_Post(ES_Handle, e, iEntity, iHost, iHostFlags, iPlayer, iSet)
{
if(pev_valid(iEntity))
{
if(!PodiumEnt)
{
PodiumEnt = find_ent_by_class(0, "corePodium");
ClassCount = getClassExtensionCount();
LeftAvatarEnt = find_ent_by_class(0, "coreAvatar");
RightAvatarEnt = LeftAvatarEnt + 1;
MiddleAvatarEnt = RightAvatarEnt + 1;
/*
更多选人界面API:
界面相机实体find_ent_by_class(0, "coreCamera");
特写相机实体find_ent_by_class(0, "coreCameraCloseUp");
上方面板实体find_ent_by_class(0, "corePanelCorona");
下方面板实体find_ent_by_class(0, "corePanelClass");
帮助面板实体find_ent_by_class(0, "corePanelHelp");
爆气实体find_ent_by_class(0, "coreAura");
*/
new Float: PodiumOrg[3];
pev(PodiumEnt, pev_origin, PodiumOrg);
MiddleAvatarNone = pev(MiddleAvatarEnt, pev_modelindex);
}
if(iEntity == MiddleAvatarEnt)
{
if(get_es(ES_Handle, ES_ModelIndex) == MiddleAvatarNone) // 判断玩家是否正在选择人物
{
PodiumVisible[iHost] = false;
return;
}
else
{
PodiumVisible[iHost] = true;
}
if(get_es(ES_Handle, ES_ModelIndex) == pev(iHost, pev_modelindex))// 进入选人界面
{
new ClassID = getClientDATAc(iHost, cliClass);
AvatarLevel = 0;
if(ClassID == 0) LeftAvatarClass = ClassCount - 1; else LeftAvatarClass = ClassID - 1;
if(ClassID == ClassCount - 1) RightAvatarClass = 0; else RightAvatarClass = ClassID + 1;
MiddleAvatarClass = ClassID;
LeftAvatarMID = getLevelDATAc(LeftAvatarClass, 0, cxlModelIndex);
RightAvatarMID = getLevelDATAc(RightAvatarClass, 0, cxlModelIndex);
MiddleAvatarMID = pev(iHost, pev_modelindex);
AvatarLevel = getClientDATAc(iHost, cliLevel);
@getLevelINFO(MiddleAvatarClass);
}
if(get_es(ES_Handle, ES_ModelIndex) == LeftAvatarMID)// 向左切换人物
{
AvatarLevel = 0;
if(LeftAvatarClass == 0) LeftAvatarClass = ClassCount - 1; else LeftAvatarClass--;
if(RightAvatarClass == 0) RightAvatarClass = ClassCount - 1; else RightAvatarClass--;
if(MiddleAvatarClass == 0) MiddleAvatarClass = ClassCount - 1; else MiddleAvatarClass--;
LeftAvatarMID = getLevelDATAc(LeftAvatarClass, 0, cxlModelIndex);
RightAvatarMID = MiddleAvatarMID;
MiddleAvatarMID = get_es(ES_Handle, ES_ModelIndex);
@getLevelINFO(MiddleAvatarClass);
}
if(get_es(ES_Handle, ES_ModelIndex) == RightAvatarMID)// 向右切换人物
{
AvatarLevel = 0;
if(LeftAvatarClass == ClassCount - 1) LeftAvatarClass = 0; else LeftAvatarClass++;
if(RightAvatarClass == ClassCount - 1) RightAvatarClass = 0; else RightAvatarClass++;
if(MiddleAvatarClass == ClassCount - 1) MiddleAvatarClass = 0; else MiddleAvatarClass++;
LeftAvatarMID = MiddleAvatarMID;
RightAvatarMID = getLevelDATAc(RightAvatarClass, 0, cxlModelIndex);
MiddleAvatarMID = get_es(ES_Handle, ES_ModelIndex);
@getLevelINFO(MiddleAvatarClass);
}
if(get_es(ES_Handle, ES_ModelIndex) == NextLevelMID)// 向上切换人物等级
{
AvatarLevel++;
@getLevelINFO(MiddleAvatarClass);
}
if(get_es(ES_Handle, ES_ModelIndex) == PreLevelMID)// 向下切换人物等级
{
AvatarLevel--;
@getLevelINFO(MiddleAvatarClass);
}
// 以下是获取到的情报
getClassDATAv(MiddleAvatarClass, cxName, szAvatarClass, 32);
getLevelDATAv(MiddleAvatarClass, AvatarLevel, cxlName, szAvatarLevel, 32);
getLevelDATAv(MiddleAvatarClass, AvatarLevel, cxlModel, szAvatarModel);
client_print(iHost, print_chat, "Class: %s*Level: [%d/%d]%s", szAvatarClass, AvatarLevel, getClassDATAc(MiddleAvatarClass, cxLevels) - 1, szAvatarLevel);
client_print(iHost, print_chat, "Model: %s", szAvatarModel);
/* 获取更多API请自行翻阅ipci/Ascend.inc和shared/Ascend.inc */
}
}
}
public @getLevelINFO(Class)
{
if(getClassDATAc(Class, cxLevels) == 1 || AvatarLevel < 0 || AvatarLevel >= getClassDATAc(Class, cxLevels)) return;
NextLevelMID = getLevelDATAc(MiddleAvatarClass, AvatarLevel + 1, cxlModelIndex);
PreLevelMID = getLevelDATAc(MiddleAvatarClass, AvatarLevel - 1, cxlModelIndex);
}
Last edited: