m0d_sa How to code SAMP mods in C++

I want to code a mod(hack) fot GTA:SA-MP, but the cleo library is too hard, it seems like assembly. Is there a way I can code my own code in C++, or other static strongly typed language?
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
475
Solutions
9
Reaction score
168
Location
Poland
AHK - AutoHotkey is simple with libary for SA:MP https://github.com/SAMP-UDF/SAMP-UDF-for-AutoHotKey/blob/master/SAMP.ahk.
Example:
PHP:
#SingleInstance Force
#NoEnv
#Include SAMP.ahk
#IfWinActive GTA:SA:MP
SetWorkingDir %A_ScriptDir%
SetBatchLines -1
SendMode Input

1::
{
    count++
    settimer, Aktywacja, 500
}
return

Aktywacja:
{
    if (count = 1)
    {
        toggle := !toggle
        
        if(toggle)
        {
            ShowGameText("~w~LSS Mechanik ~g~Wlaczony", 1337, 5)
            SetTimer, LSS_Mechanik, 500
        }
        else
        {
            ShowGameText("~w~LSS Mechanik ~r~Wylaczony", 1337, 5)
            SetTimer, LSS_Mechanik, Off
            Reload
        }
    }
    count := 0
}
return

LSS_Mechanik:
{    
    ShowGameText("~y~1: wchodze do auta", 137, 5)
    SendInput {f down}
    Sleep 30
    SendInput {f up}
    Sleep 5000
    
    ShowGameText("~y~2: wpisuje felgi", 137, 5)
    SendInput {f6}/p felgi{enter}
    Sleep 2000
    
    ShowGameText("~y~3: wpisuje id i kwote", 137, 5)
    SendInput 101 0{enter}
    Sleep 2000
    
    ShowGameText("~y~4: akceptuje dialog", 137, 5)
    SendInput {enter}
    Sleep 3000
    
    ShowGameText("~y~5: obracam kamere i ustawiam sie", 137, 5)
    MouseMove -7.0, -2.0, 0, R
    Sleep 100
    MouseMove 0, 0, 0, R
    Sleep 100
    SendInput {d down}
    Sleep 450
    SendInput {d up}
    Sleep 100
    SendInput {d down}
    Sleep 400
    SendInput {d up}
    
    ShowGameText("~y~6: czekam 195 sekund", 137, 5)
    Sleep 200000
    
    ShowGameText("~y~7: akceptuje dialog", 137, 5)
    SendInput {enter}
    Sleep 5000
    
    ShowGameText("~y~8: otwieram pojazd", 137, 5)
    SendInput {f6}/v z{enter}
    Sleep 3000
    
    ShowGameText("~y~9: wsiadam do pojazdu", 137, 5)
    SendInput {f down}
    Sleep 30
    SendInput {f up}
    Sleep, 5000
    
    ShowGameText("~y~10: otwieram dodatki", 137, 5)
    SendInput {f6}/v{enter}
    Sleep 3000
    SendInput {Down}
    Sleep 100
    SendInput {Down}
    Sleep 100
    SendInput {Down}
    Sleep 100
    SendInput {Down}
    Sleep 100
    SendInput {Down}
    Sleep 3000
    
    ShowGameText("~y~11: demontuje kurestwo", 137, 5)
    SendInput {enter}
    Sleep 3000
    ShowGameText("~y~12: testowo naciskam enter", 137, 5)
    SendInput {enter}
    Sleep 4000
    ShowGameText("~y~13: wychodze z auta", 137, 5)
    SendInput {f down}
    Sleep 30
    SendInput {f up}
    Sleep 5000
}
return
 
Top