CLEO ASI/DLL Help .CS to .ASI

CLEO related

meudeusdoceu

New member
Joined
Jul 28, 2025
Messages
2
Reaction score
0
Hello. I need help rewriting a CLEO script into .ASI.
This script allows passing through walls and flying.
It works without SAMPFUNCS and is, according to the author, undetectable on servers.
I want to rewrite it as .asi so it does not depend on CLEO.
I am a beginner in programming.
It is, let's say, a simple script.

notepad++_41KNLLfYhg.png
 

SobFoX

Expert
Joined
Jul 14, 2015
Messages
1,542
Solutions
7
Reaction score
947
Location
Israel
G0D BLESS AI
C++:
#include <windows.h>
#include <cmath>
#include "plugin.h"
#include "CVector.h"
#include "CPad.h"
#include "CWorld.h"
#include "CObject.h"
#include "CObjectData.h"
#include "CModelInfo.h"
#include "CPools.h"
#include "CPlayerPed.h"
#include "CStreaming.h"

using namespace plugin;

void SpawnObjectInFrontOfPlayer() {
    CPlayerPed* player = FindPlayerPed();
    if (!player) return;

  
    CVector pos = player->GetPosition();
    float heading = player->m_fCurrentRotation; 
    float distance = 0.7f; 

 
    pos.x += sinf(heading) * distance;
    pos.y += cosf(heading) * distance;
    pos.z -= 1.12f; // תיקון גובה

    int modelId = 2632; 
    CStreaming::RequestModel(modelId, 0);
    CStreaming::LoadAllRequestedModels(false);

    CObject* obj = new CObject(modelId, false);
    if (!obj) return;

    obj->SetPosn(pos);
    obj->SetHeading(heading - 1.57f); 
    CWorld::Add(obj);

    Sleep(200);
    CWorld::Remove(obj);
    obj->DeleteRwObject();
    delete obj;

    CStreaming::SetModelIsDeletable(modelId);
}

DWORD WINAPI MainThread(LPVOID)
{
    while (true) {
        if (GetAsyncKeyState('W') & 0x8000 && GetAsyncKeyState('X') & 0x8000) {
            SpawnObjectInFrontOfPlayer();
            Sleep(500);
        }
        Sleep(50);
    }
    return 0;
}

BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID)
{
    if (reason == DLL_PROCESS_ATTACH) {
        DisableThreadLibraryCalls(hModule);
        CreateThread(nullptr, 0, MainThread, nullptr, 0, nullptr);
    }
    return TRUE;
}
 

meudeusdoceu

New member
Joined
Jul 28, 2025
Messages
2
Reaction score
0
G0D BLESS AI
C++:
#include <windows.h>
#include <cmath>
#include "plugin.h"
#include "CVector.h"
#include "CPad.h"
#include "CWorld.h"
#include "CObject.h"
#include "CObjectData.h"
#include "CModelInfo.h"
#include "CPools.h"
#include "CPlayerPed.h"
#include "CStreaming.h"

using namespace plugin;

void SpawnObjectInFrontOfPlayer() {
    CPlayerPed* player = FindPlayerPed();
    if (!player) return;

 
    CVector pos = player->GetPosition();
    float heading = player->m_fCurrentRotation;
    float distance = 0.7f;

 
    pos.x += sinf(heading) * distance;
    pos.y += cosf(heading) * distance;
    pos.z -= 1.12f; // תיקון גובה

    int modelId = 2632;
    CStreaming::RequestModel(modelId, 0);
    CStreaming::LoadAllRequestedModels(false);

    CObject* obj = new CObject(modelId, false);
    if (!obj) return;

    obj->SetPosn(pos);
    obj->SetHeading(heading - 1.57f);
    CWorld::Add(obj);

    Sleep(200);
    CWorld::Remove(obj);
    obj->DeleteRwObject();
    delete obj;

    CStreaming::SetModelIsDeletable(modelId);
}

DWORD WINAPI MainThread(LPVOID)
{
    while (true) {
        if (GetAsyncKeyState('W') & 0x8000 && GetAsyncKeyState('X') & 0x8000) {
            SpawnObjectInFrontOfPlayer();
            Sleep(500);
        }
        Sleep(50);
    }
    return 0;
}

BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID)
{
    if (reason == DLL_PROCESS_ATTACH) {
        DisableThreadLibraryCalls(hModule);
        CreateThread(nullptr, 0, MainThread, nullptr, 0, nullptr);
    }
    return TRUE;
}
Thanks, you're the man. But now can you give me some guidance on how to create it in .asi, or can you do it for me?
 
Top