CLEO Help Auto Vehicle Lock for RP Servers

CLEO related
Status
Not open for further replies.

ChampaRando

Active member
Joined
Jan 17, 2020
Messages
62
Reaction score
3
Location
INDIA
Hey guys, I'm a fairly knowledged Java/JavaScript/Python programmer but again, very new to CLEO.

So, I play in a RP server (HZRP, easy) and I am thinking of implementing a CLEO that autolocks my car (maybe type CMD in /pvl) automatically if I start to drive it and it is unlocked. I know exactly the logical steps to implement it but not sure in SAMP with the OPCodes and whatever. Here is what Im thinking, lemme know if each step is possible or not, and if so, how/which OPCODE can I use to implement it? Cheers. Willing to share this script with public as well after / if I make it work.

So, best way I think is if CLEO can detect if a car is LOCKED (I am aware a car lock may be a server-sided thing but seriously it has SOME GTA SA client local logic because if a car is locked, our player cant enter at all. Its like how cars are locked in GTA SA story mode? I'm thinking best way could be, as soon as I hit my F/Return key (we can maybe hard-program if key pressed), script checks if nearby vehicle is locked or not. If locked; send CMD /pvl (to unlock), if unlocked, leave it as is.

I also wanna implement some cooler features, if they're possible or not; For example, if I am driving a car, and I leave the car (so maybe CLEO can know that im currently driving, then if I exit my vehicle, it again quickly checks if its locked or not, if locked, do nothing, else if unlocked, lock the vehicle just as I leave).

Last feature im thinking about is auto-lock. For example, once I enter a car, and script unlocks it for me prior to entering, after say for example 10 seconds of being INSIDE the CAR (so can CLEO do a timer/count, with IsPlayerInVehicle or some OPCODE, this is what im not sure of), then if in car for longer than 10 seconds, send /pvl to autolock vehicle?

What do you guys think? I know the logic behind it, not sure of how to implement as I dont know any APIs for CLEO.

Thanks.
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
Hey guys, I'm a fairly knowledged Java/JavaScript/Python programmer but again, very new to CLEO.

So, I play in a RP server (HZRP, easy) and I am thinking of implementing a CLEO that autolocks my car (maybe type CMD in /pvl) automatically if I start to drive it and it is unlocked. I know exactly the logical steps to implement it but not sure in SAMP with the OPCodes and whatever. Here is what Im thinking, lemme know if each step is possible or not, and if so, how/which OPCODE can I use to implement it? Cheers. Willing to share this script with public as well after / if I make it work.
It is possible. You just need to discover the proper syntax and opcodes that you need.

So, best way I think is if CLEO can detect if a car is LOCKED (I am aware a car lock may be a server-sided thing but seriously it has SOME GTA SA client local logic because if a car is locked, our player cant enter at all. Its like how cars are locked in GTA SA story mode? I'm thinking best way could be, as soon as I hit my F/Return key (we can maybe hard-program if key pressed), script checks if nearby vehicle is locked or not. If locked; send CMD /pvl (to unlock), if unlocked, leave it as is.
Code:
{$CLEO .cs}
0000: client sided car unlocker
while true
    wait 0
    if 09DE:   actor $PLAYER_ACTOR entering_car
    then
        00A0: store_actor $PLAYER_ACTOR position_to 0@ 1@ 2@
        float 3@ // declare 3@ as a float so that the for loop will work properly
        for 3@ = 1.0 to 10.0 step 0.5
            if 0AE2: 4@ = random_vehicle_near_point 0@ 1@ 2@ in_radius 3@ find_next 0 pass_wrecked 1 // findnext = 0 resets the target ped pool
            then // condition becomes true if there is a car nearby, thus the 4@ variable holds the nearest car
                020A: set_car 0@ door_status_to 1 // 1 = forces the door to be unlocked no matter what // there are many values for door status, for more info about door status visit https://gtagmodding.com/opcode-database/opcode/020A/
                break // stop the loop since we got the nearest car already
            end
        end
    end
end
Code:
{$CLEO .cs}
0000: server sided car unlocker(REQUIRES SAMPFUNCS)
while true
    wait 0
    if 09DE:   actor $PLAYER_ACTOR entering_car
    then
        00A0: store_actor $PLAYER_ACTOR position_to 0@ 1@ 2@
        float 3@ // declare 3@ as a float so that the for loop will work properly
        for 3@ = 1.0 to 10.0 step 0.5
            if 0AE2: 4@ = random_vehicle_near_point 0@ 1@ 2@ in_radius 3@ find_next 0 pass_wrecked 1 // findnext = 0 resets the target ped pool
            then // condition becomes true if there is a car nearby, thus the 4@ variable holds the nearest car
                09B3: get_car 4@ door_status_to 0@
                if or // checks if the door is locked, for more info about door status visit https://gtagmodding.com/opcode-database/opcode/020A/
                    0@ == 2 // locked
                    0@ == 4 // locked
                    0@ == 5 // locked (cop car doors)
                    0@ == 7 // locked even if there are no doors
                    0@ == 8 // locked
                then say "/pvl" // sends the chat word /pvl to the server
                end
                break // stop the loop since we got the nearest car already
            end
        end
    end
end

I also wanna implement some cooler features, if they're possible or not; For example, if I am driving a car, and I leave the car (so maybe CLEO can know that im currently driving, then if I exit my vehicle, it again quickly checks if its locked or not, if locked, do nothing, else if unlocked, lock the vehicle just as I leave).
Code:
{$CLEO .cs}
0000: Client Sided car auto-doorlocker

while true
    wait 0
    if 00DF:   actor $PLAYER_ACTOR driving
    then
        03C0: 0@ = actor $PLAYER_ACTOR car // store the car
        while 00DF:   actor $PLAYER_ACTOR driving
            wait 0
        end // waits for our actor to leave the car
        if 056E:   car 0@ defined // make sure that even if time have passed, the car still exists
        then 020A: set_car 0@ door_status_to 2 // 2 = locked, forces the car to lock its doors, if did not work, use other door status values at  https://gtagmodding.com/opcode-database/opcode/020A/
        end
    end
end

Last feature im thinking about is auto-lock. For example, once I enter a car, and script unlocks it for me prior to entering, after say for example 10 seconds of being INSIDE the CAR (so can CLEO do a timer/count, with IsPlayerInVehicle or some OPCODE, this is what im not sure of), then if in car for longer than 10 seconds, send /pvl to autolock vehicle?
There is a Flaw, does /pvl toggles the door status? Meaning:
  • typing /pvl on a locked vehicle will unlock the nearest vehicle
  • typing /pvl on a unlocked vehicle will lock the nearest vehicle


What do you guys think? I know the logic behind it, not sure of how to implement as I dont know any APIs for CLEO.

Thanks.
Try reading the comments of my codes and you might come up on a better combination of ideas than mine...
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
Just make it with python it almost same
Hey guys, I'm a fairly knowledged Java/JavaScript/Python programmer but again, very new to CLEO.

I agree on @Parazitas . It is a good practice to create a "third party code injector application" since you might encounter servers who requires installation of Anti-Cheat Applications at the client side which detects cleo scripts. Using Third Party Applications makes Scripts or even cheating hard to detect...
 

ChampaRando

Active member
Joined
Jan 17, 2020
Messages
62
Reaction score
3
Location
INDIA
Agreed agreed. Thanks ajom, i'll try these CLEO snippets soon (just busy for a bit). Also with CLEO, can we do functional programming? Like can I invokve functions as I need them or does it all have to be in one big script execution?

Also, any tutorials on how to use Python with GTA SA APIs? I have no idea how to integrate it with SAMP.

Also /pvl is server-sided CMD right, and it toggles lock, so if unlocked --> lock, else the vice-versa. Handled by HZRP server itself. So all I would need is once I entered in a car, 10 seconds later, perform a check, if locked, exit, else lock (send /pvl, its a toggler).
 

ChampaRando

Active member
Joined
Jan 17, 2020
Messages
62
Reaction score
3
Location
INDIA
Also, I never really understood these OPCODE examples given in databases. For example consider this;
09B3: get_car 4@ door_status_to 0@

How doe that CMD even work? I understnd that 4@ is a variable that has the CAR we are changing locks of. 0@ is the status of the lock state right?
But can we change "get_car" to anything else? Like do we have to call it "get_car" or even something silly like "myHotCar"?
Also same with "door_status_to" is this an official syntax or just a keyword? I think database called it "store_to".
Can it be anything?
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
Also with CLEO, can we do functional programming? Like can I invokve functions as I need them or does it all have to be in one big script execution?
  • @monday Made a good tutorial for custom SCM Functions
  • This Site also gave a good explanation of creating functions
  • Opcode 0AB1 is "call a function". It creates another thread just to do your bidding, like convensional function it does not use any variables on your current thread, but can return certain parameters towards your current script thread.
  • If you want something advance. Try reading This.

Also, any tutorials on how to use Python with GTA SA APIs? I have no idea how to integrate it with SAMP.
You need to create your own API ofcourse. Creating scripts other than cleo requires Manual Memory Hacking. It is actually very easy to hack memory because the GTA SA is Memory is well documented. There are already many memory addresses defined its uses with this websites:
https://gtamods.com/wiki/Memory_Addresses_(SA)
https://gtaforums.com/topic/194199-documenting-gta-sa-memory-addresses/

Also /pvl is server-sided CMD right, and it toggles lock, so if unlocked --> lock, else the vice-versa. Handled by HZRP server itself. So all I would need is once I entered in a car, 10 seconds later, perform a check, if locked, exit, else lock (send /pvl, its a toggler).
Code:
{$CLEO .cs}
0000: Auto car door unlocker and locker combo(untested)

:mystart
    wait 0
    
    // car door unlocker
    if 09DE:   actor $PLAYER_ACTOR entering_car
    then
        00A0: store_actor $PLAYER_ACTOR position_to 0@ 1@ 2@
        float 3@ // declare 3@ as a float so that the for loop will work properly
        for 3@ = 1.0 to 10.0 step 0.5
            if 0AE2: 4@ = random_vehicle_near_point 0@ 1@ 2@ in_radius 3@ find_next 0 pass_wrecked 1 // findnext = 0 resets the target ped pool
            then // condition becomes true if there is a car nearby, thus the 4@ variable holds the nearest car
                09B3: get_car 4@ door_status_to 0@
                if or // checks if the door is locked, for more info about door status visit https://gtagmodding.com/opcode-database/opcode/020A/
                    0@ == 2 // locked
                    0@ == 4 // locked
                    0@ == 5 // locked (cop car doors)
                    0@ == 7 // locked even if there are no doors
                    0@ == 8 // locked
                then
                    say "/pvl" // sends the chat word /pvl to the server
                    wait 2000 // give time for the server to unlock the car to avoid spamming /pvl message
                end
                break // stop the loop since we got the nearest car already
            end
        end
    else
        if 00DF:   actor $PLAYER_ACTOR driving
        then
            // TIMERA = 32@
            // TIMERB = 33@
            // 32@(aka TIMERA) and 33@(aka TIMERB) are "millisecond TIMER" variables. Meaning that its value changes/increased by the CLOCK as time passes by. It should not be used on other purposes
            TIMERA = 0 // sets the 32@ to 0ms
            REPEAT
                if 00DF:   actor $PLAYER_ACTOR driving
                then wait 0
                else jump @mystart // go back to the beggining of the script because I am not driving anymore
                end
            UNTIL TIMERA >= 10000 // wait for 32@ to become 10 seconds


            // I modified the opcode comments for you to have some confidence changing them
            03C0: 0@ = my_actress $PLAYER_ACTOR awesome_car
            09B3: what_is_my_HotCar_doorstatus 0@ store_to 0@ // 0@ as input can also become output, there will be no problem
            if or // checks if the door is unlocked, for more info about door status visit https://gtagmodding.com/opcode-database/opcode/020A/
                0@ == 1 // unlocked
                0@ == 3 // unlocked for NPC's
                0@ == 6 // unlocked, doors stay on car
            then
                say "/pvl" // sends the chat word /pvl to the server
                wait 2000 // give time for the server to unlock the car to avoid spamming /pvl message
            end
        end
    end
jump @mystart

Also, I never really understood these OPCODE examples given in databases. For example consider this;

  • Opcodes(high level) are synonimous to mneumonics(low level) - it tells the Cleo a certain job it knows how to do
  • Opcodes are functions created by the Cleo creator. The Cleo creator created it since it is helpful. Also, it can also be combinations of multiple gtasa scm-functions scripted together as One Opcode

09B3: get_car 4@ door_status_to 0@

How doe that CMD even work? I understnd that 4@ is a variable that has the CAR we are changing locks of. 0@ is the status of the lock state right?
But can we change "get_car" to anything else? Like do we have to call it "get_car" or even something silly like "myHotCar"?
Also same with "door_status_to" is this an official syntax or just a keyword? I think database called it "store_to".
Can it be anything?
Opcodes are what matters. For example, with opcode 09B3 you can even do this:
Code:
09B3: 4@ 0@
So in short, the "get_car" and "door_status_to" are nothing, and is treated as comments by Cleo.asi. The thing Cleo.asi knows is that opcode 09B3 needs two variables:
  • First variable is a variable to be reader(input)
  • Second variable is a returnimg variable(output)
Code:
09B3: this_is_a_comment 4@ also_this_is_a_comment 0@
 

ChampaRando

Active member
Joined
Jan 17, 2020
Messages
62
Reaction score
3
Location
INDIA
Also I am trying to detect if in my chat, the last message sent is "You are not near any vehicle that you own." - this is send by server, basically I wanna check if I the CAR has a LOCK INSTALLED or not (this is server sided to 1 way to check is, is to send /pvl and if it does, server doesnt say anything, but if no lock/not your own car, it says "You are not near any vehicle that you own".
So I tried this: if 0AD4: 0@ = scan_string 3@v format "You are not near any vehicle that you own."
But i am confused on how this opcode works. I tried it, it kept giving me the opposite to what I think it should do
What is 0@ going to have? So will this return TRUE if last message in chat is "You are not near any vehicle you own" or will it return false?

GTAGarage documentation is too confusing for tis function.

I believe I am not feeding it the correct string. How can I get it to check for last message in samp?
 
Last edited:

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
So I tried this: if 0AD4: 0@ = scan_string 3@v format "You are not near any vehicle that you own."
But i am confused on how this opcode works. I tried it, it kept giving me the opposite to what I think it should do
What is 0@ going to have? So will this return TRUE if last message in chat is "You are not near any vehicle you own" or will it return false?
That is a Parameter Sensitive String Search Opcode. The whole message must me xactly the same as the string you are searching. The Thing about chat messages is that they have chat colors right? That simply means that you are missing some color indicators before or after the message like "{ff0000}You are not near any vehicle that you own."

To make things easier, you need to do a "case insensitive substring search":
Code:
{$CLEO .cs}
0000: requires SAMPFUNCS

while true
    wait 0

    0AB1: @GETCHATENTRYTEXT 1 id 99 to 0@
    if 0C29: 2@ = stristr string1 0@ string2 "You are not near any vehicle that you own" // checks if a "SUBSTRING" exists // requires SAMPFUNCS
    then 0ACD: show_text_highpriority "The nearby car might have no locks, or does not belong to you!" time 2000
    else 0ACD: show_text_highpriority "There is a nearby car that you own with a DoorLock" time 2000
    end
end

:getChatEntryText
0AF7: samp 1@ = get_base
1@ += 0x21A0E4
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 0x136
0@ *= 252 // size of stChatEntry
005A: 1@ += 0@ // (int)
1@ += 28
0AB2: 1 1@
 

ChampaRando

Active member
Joined
Jan 17, 2020
Messages
62
Reaction score
3
Location
INDIA
That is a Parameter Sensitive String Search Opcode. The whole message must me xactly the same as the string you are searching. The Thing about chat messages is that they have chat colors right? That simply means that you are missing some color indicators before or after the message like "{ff0000}You are not near any vehicle that you own."

To make things easier, you need to do a "case insensitive substring search":
Code:
{$CLEO .cs}
0000: requires SAMPFUNCS

while true
    wait 0

    0AB1: @GETCHATENTRYTEXT 1 id 99 to 0@
    if 0C29: 2@ = stristr string1 0@ string2 "You are not near any vehicle that you own" // checks if a "SUBSTRING" exists // requires SAMPFUNCS
    then 0ACD: show_text_highpriority "The nearby car might have no locks, or does not belong to you!" time 2000
    else 0ACD: show_text_highpriority "There is a nearby car that you own with a DoorLock" time 2000
    end
end

:getChatEntryText
0AF7: samp 1@ = get_base
1@ += 0x21A0E4
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 0x136
0@ *= 252 // size of stChatEntry
005A: 1@ += 0@ // (int)
1@ += 28
0AB2: 1 1@
It has no colours I believe. This is straight from my chatlog "[22:16:34] You are not near any vehicle that you own." Has no chat colours, as compared to "[22:16:45] {FFA500}Vehicle radio station:{FFFFFF} None - {FFA500}Genre:{FFFFFF} None {FFA500}(Use /setradio)" which does. The timestamp is my samp's own settings, it shouldn't matter right?
 

18usat

New member
Joined
Aug 19, 2020
Messages
4
Reaction score
0
Location
usa
[QUOTE = "ajom, post: 129118, membro: 63930"] Este é um Opcode de pesquisa de string sensível a parâmetros. A mensagem inteira deve ser exatamente igual à string que você está procurando. O problema das mensagens de chat é que elas têm cores de chat, certo? Isso significa simplesmente que estão faltando alguns indicadores de cor antes ou depois da mensagem como "{ff0000} Você não está perto de nenhum veículo que possui."

Para tornar as coisas mais fáceis, você precisa fazer uma " pesquisa de substring que não diferencia maiúsculas de minúsculas ":
[CÓDIGO] {$ CLEO .cs}
0000: requer SAMPFUNCS

enquanto verdadeiro
espere 0

0AB1: @GETCHATENTRYTEXT 1 id 99 a 0 @
if 0C29: 2 @ = stristr string1 0 @ string2 "Você não está perto de nenhum veículo de sua propriedade" // verifica se existe um "SUBSTRING" // requer SAMPFUNCS
then 0ACD: show_text_highpriority "O carro próximo pode não ter cadeados ou não pertencer a você!" tempo 2000
else 0ACD: show_text_highpriority "Há um carro próximo que você possui com um DoorLock" time 2000
fim
fim

: getChatEntryText
0AF7: samp 1 @ = get_base
1 @ + = 0x21A0E4
0A8D: 1 @ = read_memory 1 @ size 4 virtual_protect 0
1 @ + = 0x136
0 @ * = 252 // tamanho de stChatEntry
005A: 1 @ + = 0 @ // (int)
1 @ + = 28
0AB2: 1 1 @ [/ CODE] [/ QUOTE]

você pode me ajudar em um arquivo cleo também?

Preciso de ajuda para codificá-lo.

Você pode me ajudar?
http://ugbase.eu/index.php?threads/help-me-fast.22045/
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
It has no colours I believe. This is straight from my chatlog "[22:16:34] You are not near any vehicle that you own." Has no chat colours, as compared to "[22:16:45] {FFA500}Vehicle radio station:{FFFFFF} None - {FFA500}Genre:{FFFFFF} None {FFA500}(Use /setradio)" which does. The timestamp is my samp's own settings, it shouldn't matter right?
Did my script work or not? Try compiling the script and do the thing that generates that chat message, and gxt text below will show up a message
 

ChampaRando

Active member
Joined
Jan 17, 2020
Messages
62
Reaction score
3
Location
INDIA
Did my script work or not? Try compiling the script and do the thing that generates that chat message, and gxt text below will show up a message
Your script looks pretty good, however I am facing an issue. Here is my code, i'll explain the issue. I haven't finished it either yet.
PHP:
{$CLEO .cs}
0000: Smart Auto Personal Vehicle Lock
wait 10000
while true
wait 200
    if 0AB1: call_scm_func @vehEnterKeys noParams 0 _returnedResult //Checks if any vehicle entering keys are pressed or not.
    then
        if 0AB1: call_scm_func @isVehicleNearby noParams 0 _returnedResult //Checks if any vehicle is nearby or not.
        then
            if 0AB1: call_scm_func @doesLockExist noParams 0 _returnedResult //Checks if current vehicle has a lock or not.
            then
                0AF8: samp add_message_to_chat "YES, LOCK EXISTS" color 0x00FF00
            else
                0AF8: samp add_message_to_chat "NO LOCK" color 0x00FF00
            end
        end
    end
end

:vehEnterKeys
//0AF8: samp add_message_to_chat "1" color 0x00FF00
if or
    0AB0:   key_pressed 17 //ENTER
    0AB0:   key_pressed 70 //F
    0AB0:   key_pressed 71 //G
then
    0485:  return_true
else
    059A:  return_false
end
0AB2: ret 0
////END OF FUNCTION////

:isVehicleNearby
0AF8: samp add_message_to_chat "2" color 0x00FF00
00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@
if 0AE2: 4@ = random_vehicle_near_point 1@ 2@ 3@ in_radius 5.0 find_next 0 pass_wrecked 1 // findnext = 0 resets the target ped pool
then // condition becomes true if there is a car nearby, thus the 4@ variable holds the nearest car
    0485:  return_true
else
    059A:  return_false
end
0AB2: ret 0
////END OF FUNCTION////
    

:doesLockExist
wait 1500 //let Radio messages pop in
0AF9: samp say_msg "/pvl" //Send /pvl to see if server returns "No vehicle
wait 1000 //give time for server to generate No Lock message if needed.
0AB1: @getLastChatMsg 1 id 99 to 2@ //2@ now has last chat message
if 0C29: 3@ = stristr string1 2@ string2 "You are not near any vehicle that you own" // checks if a "SUBSTRING" exists // requires SAMPFUNCS
then
    0AF8: samp add_message_to_chat "return false, no lock" color 0x00FF00
    0485: return_false //YES, server generated message above, vehicle has NO LOCK/NON-LOCKABLE, thus RETURN FALSE BECAUSE "doesLockExist"->no
else
    0AF8: samp add_message_to_chat "return true, lock" color 0x00FF00
    059A: return_true //I did not see msg above, so lock exists, return true
end
0AB2: ret 0
////END OF FUNCTION////

:getLastChatMsg
0AF7: samp 1@ = get_base
1@ += 0x212A6C
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 0x136
0@ *= 252 // size of stChatEntry
005A: 1@ += 0@ // (int)
1@ += 28
0AB2: 1 1@
////END OF FUNCTION////

I test this, and for some reason, it first checks if I pressed any keys to enter vehicle (F/G/ENTER). That works fine, and then it continues. Then it checks if I am near a vehicle, that works fine.
Then it needs to check if car nearby has a lock, this checks it fine, and if a car DOES HAVE A LOCK, so no message pops up, it does execute this line ( 059A: return_true //I did not see msg above, so lock exists, return true ). But in main script, I AFTER THIS, get executed this: (0AF8: samp add_message_to_chat "NO LOCK" color 0x00FF00). Which is weird since I returned true, so it should print "YES, LOCK EXISTS" in my car. It's going wrong way. Maybe I made a logic error, anyone up for a double check?
 
Last edited:

ChampaRando

Active member
Joined
Jan 17, 2020
Messages
62
Reaction score
3
Location
INDIA
I can't use "is player entering vehicle" because when vehicle is locked, it doesn't actually work. Cuz player doesnt attempt to enter in anyways, so it wont work for that. This is keypress and then veh nearby check is only what I could think of.
 

ChampaRando

Active member
Joined
Jan 17, 2020
Messages
62
Reaction score
3
Location
INDIA
Nevermind I am fucking retarded, I actually got the wrong OPCODE. Lemme test this tomorrow

Also, just tried the string scan code, I am always getting false, even when it's correct.

EDIT: It works now (scanstring). The code to get last chat line was faulty, I replaced it with this and works cool now;

PHP:
:getLastChatMsg
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x21A0E4
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x132
    0@ *= 0xFC
    005A: 1@ += 0@
    1@ += 0x20
    0AA3: 1@
END
0AB2: ret 1 1@
 
Last edited:

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
Nevermind I am fucking retarded, I actually got the wrong OPCODE. Lemme test this tomorrow

Also, just tried the string scan code, I am always getting false, even when it's correct.

EDIT: It works now (scanstring). The code to get last chat line was faulty, I replaced it with this and works cool now;

PHP:
:getLastChatMsg
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x21A0E4
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x132
    0@ *= 0xFC
    005A: 1@ += 0@
    1@ += 0x20
    0AA3: 1@
END
0AB2: ret 1 1@

Everything working now? Good job.
 
Status
Not open for further replies.
Top