CLEO HELP need callfunc help

Davidthapa

Active member
Joined
Mar 20, 2017
Messages
27
Reaction score
1
Location
Shillong, Meghalaya, India
this is c++
#include "plugin.h"
#include "CMessages.h"
#include "CTimer.h"
#include "CHud.h"

using namespace plugin;

typedef float (__cdecl* GTAFmod_Ext_GetCurrentRPM)();
GTAFmod_Ext_GetCurrentRPM gtaFmod_Ext_GetCurrentRPM;

typedef int(__cdecl* GTAFmod_Ext_GetCurrentGear)();
GTAFmod_Ext_GetCurrentGear gtaFmod_Ext_GetCurrentGear;

typedef void(__cdecl* GTAFmod_Ext_SetVehicleFMODBank)(CVehicle* vehicle, char* bank, char* absolutePath);
GTAFmod_Ext_SetVehicleFMODBank gtaFmod_Ext_SetVehicleFMODBank;

typedef void(__cdecl* GTAFmod_Ext_SetModelIdFMODBank)(int id, char* bank, char* absolutePath);
GTAFmod_Ext_SetModelIdFMODBank gtaFmod_Ext_SetModelIdFMODBank;

typedef void(__cdecl* GTAFmod_Ext_SetEngineSoundIdFMODBank)(int id, char* bank, char* absolutePath);
GTAFmod_Ext_SetEngineSoundIdFMODBank gtaFmod_Ext_SetEngineSoundIdFMODBank;


int keyTime;

class GTAFmodDashboard {
public:
GTAFmodDashboard() {
HINSTANCE moduleGTAFmod = GetModuleHandleA("GTAFmod.SA.asi");
if (moduleGTAFmod) {
gtaFmod_Ext_GetCurrentRPM = (GTAFmod_Ext_GetCurrentRPM)GetProcAddress(moduleGTAFmod, "Ext_GetCurrentRPM");
gtaFmod_Ext_GetCurrentGear = (GTAFmod_Ext_GetCurrentGear)GetProcAddress(moduleGTAFmod, "Ext_GetCurrentGear");
gtaFmod_Ext_SetVehicleFMODBank = (GTAFmod_Ext_SetVehicleFMODBank)GetProcAddress(moduleGTAFmod, "Ext_SetVehicleFMODBank");
gtaFmod_Ext_SetModelIdFMODBank = (GTAFmod_Ext_SetModelIdFMODBank)GetProcAddress(moduleGTAFmod, "Ext_SetModelIdFMODBank");
gtaFmod_Ext_SetEngineSoundIdFMODBank = (GTAFmod_Ext_SetEngineSoundIdFMODBank)GetProcAddress(moduleGTAFmod, "Ext_SetEngineSoundIdFMODBank");
}
else {
moduleGTAFmod = 0;
gtaFmod_Ext_GetCurrentRPM = 0;
gtaFmod_Ext_GetCurrentGear = 0;
gtaFmod_Ext_SetVehicleFMODBank = 0;
gtaFmod_Ext_SetModelIdFMODBank = 0;
gtaFmod_Ext_SetEngineSoundIdFMODBank = 0;
}

Events::gameProcessEvent.before += []() {
CVehicle* vehicle = FindPlayerVehicle(-1, true);

if (vehicle)
{
if (gtaFmod_Ext_GetCurrentRPM) {
float rpm = gtaFmod_Ext_GetCurrentRPM();
int gear = gtaFmod_Ext_GetCurrentGear();
CMessages::AddMessageJumpQWithNumber(new char[] {"Gear ~1~ RPM ~1~"}, 3000, 0, gear, rpm, 0, 0, 0, 0, false);
}

if (KeyPressed(VK_F7) && CTimer::m_snTimeInMilliseconds >= (keyTime + 2000))
{
gtaFmod_Ext_SetModelIdFMODBank(vehicle->m_nModelIndex, (char*)"ks_mazda_rx7_spirit_r", GAME_PATH((char*)"modloader\\GTAFmod\\banks\\ks_mazda_rx7_spirit_r.bank"));
keyTime = CTimer::m_snTimeInMilliseconds;
CHud::SetHelpMessage("Current Vehicle Model ID update", true, false, false);
}
if (KeyPressed(VK_F8) && CTimer::m_snTimeInMilliseconds >= (keyTime + 2000))
{
gtaFmod_Ext_SetVehicleFMODBank(vehicle, (char*)"ks_mazda_rx7_spirit_r", GAME_PATH((char*)"modloader\\GTAFmod\\banks\\ks_mazda_rx7_spirit_r.bank"));
keyTime = CTimer::m_snTimeInMilliseconds;
CHud::SetHelpMessage("Current Vehicle Instance update", true, false, false);
}
}
};
}
} gTAFmodDashboard;
and here what i need is rpm read by cleo idk how to do it

here is link for mod
 

Swanson

Active member
Joined
Apr 29, 2020
Messages
28
Reaction score
10
Location
Earth
Why do you dump your code here without formatting and even without any good explanation of what you're trying to achieve and what is going wrong.
 

0x_

Wtf I'm not new....
Administrator
Joined
Feb 18, 2013
Messages
1,116
Reaction score
163
@Swanson
"Why do you dump your code here without formatting and even without any good explanation of what you're trying to achieve and what is going wrong."

if i explain every thing can you do it for me ? if not then don't write here as answer
It's because your request is poorly written, the code isn't formatted in
C++:
void codetags()
{

}
CODE tags, and it's very hard to understand that you want to port something to cleo (one func call?)
 

Davidthapa

Active member
Joined
Mar 20, 2017
Messages
27
Reaction score
1
Location
Shillong, Meghalaya, India
It's because your request is poorly written, the code isn't formatted in
C++:
void codetags()
{

}
CODE tags, and it's very hard to understand that you want to port something to cleo (one func call?)
oh i didn't know that i just paste it from source from GitHub and if i know what is that. l why would i ask here ?

ok here what i want from that script or source this is for reading rpm its a sound mod but it show rpm i am making manual gear (transmission) which is like real vehicle have i have that compiled asi but its weird it stay in middle cant read other text that's why i wanted in cleo so i can do something
 
Top