Recent posts

#1
Script Showroom / Re: [Script] Simple Rob System...
Last post by KazamaOp - Today at 11:43 AM
tf man good job
#2
Script Showroom / Re: Transferstats Command
Last post by KazamaOp - Today at 11:42 AM
thanks lundbbas 8)
#3
General Discussion / Re: F8 By npc?
Last post by MEGAMIND - Today at 05:03 AM
alright undestood, and i do know all of those general information and thanks for mentioning it, acutally what i want is that some of ur plugin can take a screenshot in game and save it to the hoster pc as my c++ program does it.

so in this way ur npc can do something like takesreenshot(); this function triggers for npc but its obvious that the dll is on hoster's side so the shots will be saved there.. yet it could be possible if we had a wep camera working or we had a mobile that could take shots such as samp or gta v even gta iv...

so as for now my c++ savs the shot npc and in game i get details of what ever is being seen by npc which in actuall its a shot that is saved, my browsers reads it, send to a.i then ai returns back the reposnse and that response is shown in game.. (yea quite a long method but done in seconds...) so camera takes the shot of ur screen in actuall but when u spectae npc its from npc prespective then...

that what i am looking for that the shot gets taken by npc prespective or if a simple squirrel code solves the problem i would be happy to give credit for it...

(else ill make this feature premium and will only work when im online in game for other users lol)

give me suggestions @habi2
#4
General Discussion / Re: F8 By npc?
Last post by MEGAMIND - Dec 07, 2024, 07:05 PM
Quote from: habi2 on Dec 07, 2024, 06:20 PMI hope the code you provided is for taking screenshot.

Hi megamind, i understand you want npc to take screenshot.
 
The npc04 plugin records co-ordinates, time, distance, vehicle ids and one of the function is aimed at recreating everything that happened in server. You can record all those values. But how will you take screenshot with these functions?

I want you to understand the vcmp server is a c++ program and it doesn't know vice city game. Look at the size of server64.exe. It is 2 MB only. Do you think 700 MB game is somehow inside server with the data files, cuts, anims, paths?

Now when you move player, server knows it. It is because the client which is located in another country sends a 'packet' containing some 40 bytes. Those forty bytes contain position co-ordinate x, y, z, player health and many other details.

Let us comeback. To take photo atleast at one place, the game must be run. Client can Raytrace but cannot take screenshot and send it to server. Somebody requested this feature on this forum before. That is general player's client cannot be used for this purpose, as it neither can take nor send screenshots to server.



its not like that ill provide u my idea on ur pm... everything is being done by my browser im just looking for an ss
#5
General Discussion / Re: F8 By npc?
Last post by habi2 - Dec 07, 2024, 06:20 PM
I hope the code you provided is for taking screenshot.

Hi megamind, i understand you want npc to take screenshot.
 
The npc04 plugin records co-ordinates, time, distance, vehicle ids and one of the function is aimed at recreating everything that happened in server. You can record all those values. But how will you take screenshot with these functions?

I want you to understand the vcmp server is a c++ program and it doesn't know vice city game. Look at the size of server64.exe. It is 2 MB only. Do you think 700 MB game is somehow inside server with the data files, cuts, anims, paths?

Now when you move player, server knows it. It is because the client which is located in another country sends a 'packet' containing some 40 bytes. Those forty bytes contain position co-ordinate x, y, z, player health and many other details.

Let us comeback. To take photo atleast at one place, the game must be run. Client can Raytrace but cannot take screenshot and send it to server. Somebody requested this feature on this forum before. That is general player's client cannot be used for this purpose, as it neither can take nor send screenshots to server.


#6
General Discussion / Re: F8 By npc?
Last post by MEGAMIND - Dec 07, 2024, 03:25 PM
@habi2 can we get NPC.Cameralook something like that and save a shot in dir? like downloads? as i did with my camera.. Downloads/vcmp_screen_shots/capture.png

as what i am doing is running an exe what u mentioned earlier, we need to run a sperate instance and spec npc and that way it works fine, but we cannot always run an instance or the exe...

can u do it via plugin? with ur npc plugins as u r doing record.. so we may get one function for take pic?

heres my c++

#include <windows.h>
#include <shlobj.h>  // For SHGetKnownFolderPath
#include <knownfolders.h>  // For FOLDERID_Downloads
#include <gdiplus.h>
#include <iostream>
#include <string>
#include <thread>
#include <chrono>
#include <objbase.h>

#pragma comment(lib, "gdiplus.lib")

std::wstring StringToWString(const std::string& str) {
    return std::wstring(str.begin(), str.end());
}

void HideConsoleWindow() {
    HWND hWnd = GetConsoleWindow();
    if (hWnd != nullptr) {
        ShowWindow(hWnd, SW_HIDE);
    }
}

int GetEncoderClsid(const wchar_t* format, CLSID* pClsid) {
    UINT num = 0;
    UINT size = 0;
    Gdiplus::GetImageEncodersSize(&num, &size);
    if (size == 0) return -1;

    Gdiplus::ImageCodecInfo* pImageCodecInfo = (Gdiplus::ImageCodecInfo*)(malloc(size));
    if (pImageCodecInfo == nullptr) return -1;

    Gdiplus::GetImageEncoders(num, size, pImageCodecInfo);

    for (UINT j = 0; j < num; ++j) {
        if (wcscmp(pImageCodecInfo[j].MimeType, format) == 0) {
            *pClsid = pImageCodecInfo[j].Clsid;
            free(pImageCodecInfo);
            return j;
        }
    }
    free(pImageCodecInfo);
    return -1;
}

std::wstring GetScreenshotPath() {
    wchar_t* downloadsPath = nullptr;
    // Get the path to the user's Downloads folder
    if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_Downloads, 0, nullptr, &downloadsPath))) {
        std::wstring path = std::wstring(downloadsPath) + L"\\VCMP_SCREEN_SHOTS";
        CoTaskMemFree(downloadsPath);

        // Create the VCMP_SCREEN_SHOTS directory if it doesn't exist
        CreateDirectory(path.c_str(), nullptr);

        // Append the image file name to the path
        path += L"\\screenshot.jpg";
        return path;
    }
    return L"";  // Return an empty string on failure
}


bool CaptureScreen(const std::wstring& filePath) {
    HDC hScreenDC = GetDC(nullptr);
    HDC hMemoryDC = CreateCompatibleDC(hScreenDC);

    int screenWidth = GetSystemMetrics(SM_CXSCREEN);
    int screenHeight = GetSystemMetrics(SM_CYSCREEN);

    HBITMAP hBitmap = CreateCompatibleBitmap(hScreenDC, screenWidth, screenHeight);
    HGDIOBJ oldBitmap = SelectObject(hMemoryDC, hBitmap);

    BitBlt(hMemoryDC, 0, 0, screenWidth, screenHeight, hScreenDC, 0, 0, SRCCOPY);
    SelectObject(hMemoryDC, oldBitmap);

    Gdiplus::Bitmap bitmap(hBitmap, nullptr);
    CLSID clsid;
    bool success = false;

    if (GetEncoderClsid(L"image/jpeg", &clsid) != -1) {
        if (bitmap.Save(filePath.c_str(), &clsid, nullptr) == Gdiplus::Ok) {
            success = true;
        }
    }

    DeleteObject(hBitmap);
    DeleteDC(hMemoryDC);
    ReleaseDC(nullptr, hScreenDC);

    return success;
}

int main() {
    Gdiplus::GdiplusStartupInput gdiplusStartupInput;
    ULONG_PTR gdiplusToken;
    Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, nullptr);

    HideConsoleWindow();
    std::this_thread::sleep_for(std::chrono::seconds(1));

    std::wstring filePath = GetScreenshotPath();
    if (filePath.empty()) {
        std::wcerr << L"Failed to determine screenshot path!" << std::endl;
        Gdiplus::GdiplusShutdown(gdiplusToken);
        return 1;
    }

    if (CaptureScreen(filePath)) {
        std::wcout << L"Screenshot saved to " << filePath << std::endl;
    }
    else {
        std::wcerr << L"Failed to capture screen!" << std::endl;
    }

    Gdiplus::GdiplusShutdown(gdiplusToken);
    return 0;
}
This actualy takes pic from my angle not npc until we spec npc
#7
Videos & Screenshots / Re: TDC screenshots/videos
Last post by MEGAMIND - Dec 07, 2024, 01:46 PM
#8
Servers / Re: [0.4]Top Down City Server
Last post by MEGAMIND - Dec 06, 2024, 07:16 PM
12/07/2024 12:16am
[Addition]
  • NPC-AI now views stuff in game in realtime
  • NPC-AI has now more commands:
  • npcai what do you see

#9
General Discussion / Re: MEGAMIND'S VCMP BROWSER
Last post by MEGAMIND - Dec 06, 2024, 06:18 PM


Features
  • Added Vision for NPC to see in vcmp world (can be availed using api)
  • Requires vcmpcamera.exe to be placed in vcmp-server directory

Those who have the browser already installed will get a update automatically, those who are new to this browser can download and install the latest update



#10
Off-Topic General / Need For Speed Game - Memory E...
Last post by habi2 - Dec 06, 2024, 02:58 PM
Hi in this tutorial i will show you how to edit values in the memory of games. We have NFS Most wanted (version 3) installed.
First let us look at cash we have:

Yes we have 10134200 dollars.

1. Install and run Cheat Engine 7.5 and type the same amount in Value Field:

2. Click on First Scan
3. See what we got:

We have got a 4 bytes value same as we searched. Let us edit it. Right click on it and select Change value of selected address:

4. Enter 100 M dollars (100000000) as new value

5. It will look like this finally:

6. Now go to game and check cash (Press Esc in game and select Resume Career

Wow it worked!. You got 100 M dol cash. With this large sum, you can buy new cars now. Did you liked this tutorial ?