CLEO Help Sanny Builder Issues

CLEO related

Skyfer

Member
Joined
Feb 4, 2022
Messages
18
Reaction score
1
Location
North Korea
Hello guys
i have issues with sanny builder
first i had issue where sanny builder doesnt recognise key_down it shows it as unknown directive
i fixed it by droping ini and opecods from SAMPFuncs
second i had one issue i fixed it by change upper case to As if in settings (thanks to Parasite bro from this forums)
third i have issue with the script doesnt recognize vehicles models this code
example

Code:
00D9: 15@ = actor $PLAYER_ACTOR car
if
0137:   car 15@ model == #ELEGY
jf @0

the script didnt work becoz it doesnt recognize the car model
i tried write the integer of the car model 15@ to ini file but it the key that asigned to this is blank

fourth issue is the code my game crashes when i have this opecode is run

Code:
0C72: set_virtual_key 100 down true
wait 50
0C72: set_virtual_key 100 down false

Sorry for my bad english
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
Maybe:
  1. You fucked up somewhere in your code.
  2. You are experiencing compiler encoding problems. Try copying this Sanny Builder Settings:
 

Skyfer

Member
Joined
Feb 4, 2022
Messages
18
Reaction score
1
Location
North Korea
Maybe:
  1. You fucked up somewhere in your code.
  2. You are experiencing compiler encoding problems. Try copying this Sanny Builder Settings:


i copyied that but still no help
i created a small test script to test some opcodes

Code:
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP
thread 'cam'




:test
wait 0

if and
key_down 16
key_down 38
jf @test
print "1" 1000
wait 300
if
   Actor.Driving($PLAYER_ACTOR)
jf @test
print "2" 1000
00D9: 5@ = actor $PLAYER_ACTOR car // add to mission cleanup
0441: 6@ = car 5@ model
0AD3: 10@v = format "%d" 6@
print 10@v 1000
jump @test

as i run the script
it prints the number 2 but doesnt show the the ID of the car im driving

also my game starts freezing a for a sec and all the the water of GTA Samp Starts flashing off and on
 

Attachments

  • sa-mp-041.png
    sa-mp-041.png
    602.1 KB · Views: 9
  • sa-mp-040.png
    sa-mp-040.png
    701.6 KB · Views: 9

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
also my game starts freezing a for a sec and all the the water of GTA Samp Starts flashing off and on
You might have mods out there that causes the problem. Try launching your script on a clean GTASA + CLEO and see if it still persists.

as i run the script it prints the number 2 but doesnt show the the ID of the car im driving
  1. SB Supports High Level Syntax. Instead of using Low Level Syntax that is hard to understand/backtrace, abuse the usage of high level syntax.
  2. Try using Opcode 03C0 instead of Opcode 00D9
  3. It is a better practice to use Opcodes other than Keywords. Because in your example, the print keyword can either be Opcode 0ACC(LowPriority) or Opcode 0ACD(HighPriority).

An example for Show Car Model:
PHP:
{$CLEO}
0000: car model shower

While true
    Wait 0
    if and
        00DF: actor $PLAYER_ACTOR driving
        0AB0: key_pressed 16 // SHIFT
        0AB0: key_pressed 38 // Up Arrow
    then
        03C0: 0@ = actor $PLAYER_ACTOR car
        0441: 0@ = car 0@ model
        0AD3: 1@v = format "%d" 0@ // overwrites variables 1@, 2@, 3@, and 4@
        0ACD: show_text_highpriority 1@v time 200
    end
end
PHP:
{$CLEO}
0000: car model shower

While true
    Wait 0
    if and
        00DF: actor $PLAYER_ACTOR driving
        0AB0: key_pressed 16 // SHIFT
        0AB0: key_pressed 38 // Up Arrow
    then
        03C0: 0@ = actor $PLAYER_ACTOR car
        0441: 0@ = car 0@ model
        0AC8: 1@ = allocate_memory_size 16 // create a new memory region that can support up to 15(+1 null terminator) characters. Store the location at 1@
        0AD3: 1@ = format "%d" 0@ // write the formatting at the new memory region
        0ACD: show_text_highpriority 1@ time 200
        0AC9: free_allocated_memory 1@ // we free/forget the memory region using this opcode to avoid memory leak that can cause gtasa to crash.
    end
end


An example Elegy Detector:
PHP:
{$CLEO}
0000: Elegy Detector

While true
    Wait 0
    if and
        00DF: actor $PLAYER_ACTOR driving
        0AB0: key_pressed 16 // SHIFT
        0AB0: key_pressed 38 // Up Arrow
    then
        03C0: 0@ = actor $PLAYER_ACTOR car
        if 0137: car 0@ model == 562 // #ELEGY should work too, try changing 562 into #ELEGY later
        then 0ACD: show_text_highpriority "I'm driving an Elegy" time 200
        end
    end
end
 
Last edited:

Skyfer

Member
Joined
Feb 4, 2022
Messages
18
Reaction score
1
Location
North Korea
You might have mods out there that causes the problem. Try launching your script on a clean GTASA + CLEO and see if it still persists.


  1. SB Supports High Level Syntax. Instead of using Low Level Syntax that is hard to understand/backtrace, abuse the usage of high level syntax.
  2. Try using Opcode 03C0 instead of Opcode 00D9
  3. It is a better practice to use Opcodes other than Keywords. Because in your example, the print keyword can either be Opcode 0ACC(LowPriority) or Opcode 0ACD(HighPriority).

An example for Show Car Model:
PHP:
{$CLEO}
0000: car model shower

While true
    Wait 0
    if and
        00DF: actor $PLAYER_ACTOR driving
        0AB0: key_pressed 16 // SHIFT
        0AB0: key_pressed 38 // Up Arrow
    then
        03C0: 0@ = actor $PLAYER_ACTOR car
        0441: 0@ = car 0@ model
        0AD3: 1@v = format "%d" 0@ // overwrites variables 1@, 2@, 3@, and 4@
        0ACD: show_text_highpriority 1@v time 200
    end
end
PHP:
{$CLEO}
0000: car model shower

While true
    Wait 0
    if and
        00DF: actor $PLAYER_ACTOR driving
        0AB0: key_pressed 16 // SHIFT
        0AB0: key_pressed 38 // Up Arrow
    then
        03C0: 0@ = actor $PLAYER_ACTOR car
        0441: 0@ = car 0@ model
        0AC8: 1@ = allocate_memory_size 16 // create a new memory region that can support up to 15(+1 null terminator) characters. Store the location at 1@
        0AD3: 1@ = format "%d" 0@ // write the formatting at the new memory region
        0ACD: show_text_highpriority 1@ time 200
        0AC9: free_allocated_memory 1@ // we free/forget the memory region using this opcode to avoid memory leak that can cause gtasa to crash.
    end
end


An example Elegy Detector:
PHP:
{$CLEO}
0000: Elegy Detector

While true
    Wait 0
    if and
        00DF: actor $PLAYER_ACTOR driving
        0AB0: key_pressed 16 // SHIFT
        0AB0: key_pressed 38 // Up Arrow
    then
        03C0: 0@ = actor $PLAYER_ACTOR car
        if 0137: car 0@ model == 572 // #ELEGY should work too, try changing 572 into #ELEGY later
        then 0ACD: show_text_highpriority "I'm driving an Elegy" time 200
        end
    end
end



i removed all the mods only kept gta sa and cleo
i also tried your code ELEGY Detector
but it doesnt detect so i added a
0ACD: show_text_highpriority "1" time 2000
before the IF command of the model check
it shows the "1" but doesnt show the I'm driving an Elegy Text instead it shows 1 which proves the game skips the codes of the model check
can you compile the code you gave me into CS, to see if this a compiler error or what kind of problem

here is the code
Code:
{$CLEO}
0000: Elegy Detector

While true
    Wait 0
    if and
        00DF: actor $PLAYER_ACTOR driving
        0AB0: key_pressed 16 // SHIFT
        0AB0: key_pressed 38 // Up Arrow
    then
        03C0: 0@ = actor $PLAYER_ACTOR car
        0ACD: show_text_highpriority "1" time 2000       //// < LINE i added to see if working or not
        if 0137: car 0@ model == 572 // #ELEGY should work too, try changing 572 into #ELEGY later
        then 0ACD: show_text_highpriority "I'm driving an Elegy" time 200
        end
    end
end


screenshot it only shows 1 on new code
 

Attachments

  • sa-mp-047.png
    sa-mp-047.png
    666.6 KB · Views: 7

dphome

Well-known member
Joined
Mar 21, 2020
Messages
456
Solutions
9
Reaction score
165
Location
Poland
i removed all the mods only kept gta sa and cleo
i also tried your code ELEGY Detector
but it doesnt detect so i added a
0ACD: show_text_highpriority "1" time 2000
before the IF command of the model check
it shows the "1" but doesnt show the I'm driving an Elegy Text instead it shows 1 which proves the game skips the codes of the model check
can you compile the code you gave me into CS, to see if this a compiler error or what kind of problem

here is the code
Code:
{$CLEO}
0000: Elegy Detector

While true
    Wait 0
    if and
        00DF: actor $PLAYER_ACTOR driving
        0AB0: key_pressed 16 // SHIFT
        0AB0: key_pressed 38 // Up Arrow
    then
        03C0: 0@ = actor $PLAYER_ACTOR car
        0ACD: show_text_highpriority "1" time 2000       //// < LINE i added to see if working or not
        if 0137: car 0@ model == 572 // #ELEGY should work too, try changing 572 into #ELEGY later
        then 0ACD: show_text_highpriority "I'm driving an Elegy" time 200
        end
    end
end


screenshot it only shows 1 on new code
PHP:
{$CLEO .cs}

0000: NOP

WAIT 8500

WHILE TRUE
WAIT 0

IF 0256:   player $PLAYER_CHAR defined
THEN
    IF 00DF:   actor $PLAYER_ACTOR driving
    THEN
        IF AND
        0AB0: key_pressed 16 {Shift}
        0AB0: key_pressed 38 {Up arrow}
        THEN
            IF 00DD:   actor $PLAYER_ACTOR driving_car_with_model 562 {ELEGY = 562 https://wiki.multitheftauto.com/wiki/PL/Vehicle_IDs}
            THEN
                0ACD: show_text_highpriority "~r~I'm driving an ~g~Elegy" time 1337
            END    
        END
        WAIT 137 {Anti-spam key}    
    END
END

END
 

Attachments

  • ElegyDetector.cs
    17.9 KB · Views: 3
Last edited:

Skyfer

Member
Joined
Feb 4, 2022
Messages
18
Reaction score
1
Location
North Korea
Sorry for late guys the both codes are working the problem was the #elegy
if 0137: car 0@ model == 572
i changed it to
if 0137: car 0@ model == #elegy and it works
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
I made a typo, it should be ID 562(dphome stated). Anyway, that's why it is better to use its GXT name definition rather than its ID to avoid confusion.
 
Top