Вопрос Новый метод спавна подсада

Начинающий
Статус
Оффлайн
Регистрация
22 Дек 2018
Сообщения
29
Реакции[?]
0
Поинты[?]
0
дайте кто нибудь новый метод спавна подсада у кого есть пожалуйста имхо старый не пашет

struct CScriptSystem
{
virtual void Function0();
virtual void Function1();
virtual void Function2();
virtual void Function3();
virtual void Function4();
virtual void Function5();
// ExecuteBuffer:
// vtable index 6
virtual bool ExecuteBuffer(const char* sBuffer, size_t nSize, const char* sBufferDescription = "", interface IScriptTable* pEnv = 0) = 0;
bool ExecuteLua(std::string cmd) { return ExecuteBuffer(cmd.c_str(), cmd.size()); }
};

юзал этот
 
Начинающий
Статус
Оффлайн
Регистрация
27 Фев 2020
Сообщения
393
Реакции[?]
19
Поинты[?]
14K
а че не так то? Ты с помощью этого кода можешь вызвать спавн подсада
C++:
// Classes.h

class CScriptSystem {
public:
    virtual bool ExecuteBuffer(const char* sBuffer, size_t nSize, const char* sBufferDescription = "", interface IScriptTable* pEnv = 0) = 0;
};

class SSystemGlobalEnvironment
{
    CScriptSystem* GetILua() { return (CScriptSystem*)*(uintptr_t*)((uintptr_t)this + 0x40); }
}
C++:
//вызов функции к примеру на F5

//спавн подсада
CScriptSystem* pScriptSystem = SSystemGlobalEnvironment::Singleton()->GetILua(); if (!pScriptSystem) return;
if(GetAsyncKeyState(VK_F5) & 1) // обязательно ставим & 1, иначе будет спавнить много подсадов.
{
    pScriptSystem->ExecuteBuffer(("function GetPlayerLook()local a=System.GetViewCameraPos()local b=System.GetViewCameraDir()local c=ScaleVector(b,100)local d=DifferenceVectors(a,c)local e={}local f=Physics.RayWorldIntersection(a,c,1,ent_terrain+ent_static+ent_rigid+ent_sleeping_rigid+ent_living,g_localActor.id,NULL_ENTITY,e)return e[1]end;function SpawnHelper3(g)local h=GetPlayerLook()if h then if LastHelpers then LastHelpers:DeleteThis()end;local i=h.pos;local j={class=\"RigidBodyEx\",position=i,scale={x=1,y=1,z=1},name=\"HuliNado\",properties={object_Model=\"objects/helpers/special_moves/vault_50_20cm.cgf\"}}local k=System.SpawnEntity(j)k:SetAngles(g_localActor:GetAngles())LastHelpers=k end end;SpawnHelper3()"), 680);
//const char берется по наведению строки и помоему убавляем 1 число (или прибавляем не помню точно)
}

if(GetAsyncKeyState(VK_F6) & 1)
{
    pScriptSystem->ExecuteBuffer(("function GetPlayerLook()local a=System.GetViewCameraPos()local b=System.GetViewCameraDir()local c=ScaleVector(b,100)local d=DifferenceVectors(a,c)local e={}local f=Physics.RayWorldIntersection(a,c,1,ent_terrain+ent_static+ent_rigid+ent_sleeping_rigid+ent_living,g_localActor.id,NULL_ENTITY,e)return e[1]end;function SpawnHelper3(g)local h=GetPlayerLook()if h then if LastHelpers then LastHelpers:DeleteThis()end;local i=h.pos;local j={class=\"RigidBodyEx\",position=i,scale={x=1,y=1,z=1},name=\"HuliNado\",properties={object_Model=\"objects/helpers/special_moves/climb_380_200cm.cgf\"}}local k=System.SpawnEntity(j)k:SetAngles(g_localActor:GetAngles())LastHelpers=k end end;SpawnHelper3()"), 682);
    //const char берется так же
}
 
Сверху Снизу