Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

iFarbod

[SA] How to make ASI mods?

Recommended Posts

iFarbod

Hi Every one.

i have a question how to make asi mods.

some guys telled me must know c++

i know this language. what should i do?

thanks. :santa:

Share this post


Link to post
Share on other sites
BnB

Create a dll rename it to .asi and put it into the SA folder, also make sure you have an asi loader. Basically, it's a dll injection.

Share this post


Link to post
Share on other sites
343 guilty spark

you can only use memory addresses dont expect and API or and SDK!

i gave you some examples (kill player and get current play car)

you can compile this using wxDev-c++ as a dll then rename it to .asi and place it is the same folder as your GTA_SA.EXE, then it wont work.

i mean you still need asi loader, fool!

#include <windows.h>BOOL running;DWORD getCar(){ return *((DWORD *)0xBA18FC);} void setMoney(DWORD dw){     *(DWORD *)0xB7CE50 = dw;      *(DWORD *)0xB7CE54 = dw;  };BOOL inMenu(){    return *(byte *) 0xB7CB49 != 0;   }DWORD getPlayerPointer(){    return *(DWORD *)(0xB6F5F0);}BOOL playerAlive(){    DWORD ptr = getPlayer();    if(ptr > 0){        ptr += 0x540;        return *(float*) ptr > 0.f;    }    return false;}BOOL playerDefined(){    return getPlayer() > 0;   }float getPlayerAngle(){    return *(float *)(getPlayer() + 0x558);    }void killPlayer(){        DWORD playerPtr = getPlayer();        if(playerPtr > 0){            playerPtr += 0x540;            *(float *) playerPtr = 0.0f;        }}void run(){    running = true;    // declare vars here and do things that need to be done only one time!    while(running){         //----------------------------------------------------------         // do it here! (i did not mean poop here! DAMN IT! i meant code here what every you want)                // joke        Sleep(60000);        killPlayer();        // this is not funny! what kind of gangster gets a heart-attack every minute?         //----------------------------------------------------------        Sleep(250); // dont not remove this you can use a smaller number for faster execution    }    /* this is the end, do what you need to do before you quit, quitter! but i dont think                    asi loader will get you here, i never tried it.*/}DWORD WINAPI callable(void *parameter){ run();}extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved){switch (fdwReason){ case DLL_PROCESS_ATTACH:  CreateThread(0, 0, callable, 0, 0, 0);  break; case DLL_PROCESS_DETACH:        running = false;   break; case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH:  break;}return TRUE;}
Edited by 343 guilty spark

Share this post


Link to post
Share on other sites
DK22Pac

dont expect and API or and SDK!

False.

 

#include "plugin\plugin.h"#include "game_sa\common.h"#include "game_sa\CTimer.h"using namespace plugin;void MyProcess();unsigned int myTimer = 0;BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved){    if(reason == DLL_PROCESS_ATTACH)        Core::RegisterFunc(FUNC_GAME_PROCESS_AFTER_SCRIPTS, MyProcess);    return TRUE;}void MyProcess(){    CPed *playa = FindPlayerPed(-1);    if(playa)    {        if(!myTimer)            myTimer = CTimer::m_snTimeInMilliseconds;        if(CTimer::m_snTimeInMilliseconds - myTimer > 60000)        {            playa->m_fHealth = 0.0f;            myTimer = CTimer::m_snTimeInMilliseconds;        }    }}
Edited by _DK

Share this post


Link to post
Share on other sites
Silent

If only it wasn't a DLL... :p

Share this post


Link to post
Share on other sites
Bad.boy!

Where can I find that API _DK?

 

I always executed my code with something like this:

 

#include <Windows.h>#define FUNC_CALL    0x60EBCC#define FUNC_ADDR    (FUNC_CALL+1)#define OLD_ADDR    0x562C90extern void code (void);BYTE call = 0xE8;__declspec(naked) void setup (void){    __asm {        push    ebp        mov        ebp, esp        push    ebx        push    ecx        push    edx        call    code        pop        ebx        pop        ecx        pop        edx        mov        esp, ebp        pop        ebp        mov        eax, OLD_ADDR        jmp        eax    }}void hook (void){    DWORD protect, buf;    DWORD adr = (DWORD) ((BYTE*) &setup - (FUNC_ADDR + 4));    VirtualProtect ((void*) FUNC_ADDR, 4, PAGE_EXECUTE_READWRITE, &protect);    memcpy ((void*) FUNC_ADDR, &adr, 4);    VirtualProtect ((void*) FUNC_ADDR, 4, protect, &buf);}void unhook (void){    DWORD protect, buf = (OLD_ADDR - (FUNC_ADDR + 4));    VirtualProtect ((void*) FUNC_ADDR, 4, PAGE_EXECUTE_READWRITE, &protect);    memcpy ((void*) FUNC_ADDR, &buf, 4);    VirtualProtect ((void*) FUNC_ADDR, 4, protect, &buf);}

Share this post


Link to post
Share on other sites
DK22Pac

From my sig or here

Share this post


Link to post
Share on other sites
iFarbod

Thank you DK, Can you document your Plugin SDK in English? Or just give me an example with the "FastReload":

0331: set_player $PLAYER_CHAR fast_reload 1

OR

0331: set_player 0 fast_reload 1

I Very like to mod SA in C/C++, Thanks.

Edited by iFarbod

Share this post


Link to post
Share on other sites
fastman92

Use my class CRunningScriptWrapper from Plugin SDK.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.