Resource icon

Untagged Release No Fuel

Status
Not open for further replies.

blvck0v

Active member
Joined
Feb 23, 2019
Messages
97
Reaction score
51
Location
ugbase.eu
I were able to make it work, but can't seem to disable it.
Here is the code snippet:
Code:
if 0ADC: test_cheat "FUEL"
    then
        if 31@ == 0
        then
            31@ = 1
            0AF1: write_int 1 to_ini_file "CLEO\NoFuel.ini" section "NoFuel" key "status"
            0ACD: show_text_highpriority "nofuel on" time 1000
            SAMP.ReadSAMPMemory(33@,0x146E0,2)
            SAMP.WriteSAMPMemory(0x146E0,0xC390,2)
        else
            31@ = 0
            0AF1: write_int 0 to_ini_file "CLEO\NoFuel.ini" section "NoFuel" key "status"
            0ACD: show_text_highpriority "nofuel off" time 1000
            SAMP.WriteSAMPMemory(0x146E0,33@,2)
        end 
    end

Game crashes when I try to disable. SAMP 0.3.7

My guess is that I used 33@ as a dumbf***k. 32 and 33 are for timers lul
Not sure how I can create a variable in order to store the old memvalue of 0x146E0
try
PHP:
{$CLEO}
0000: NOP

wait 8500

if 0AAB: does_file_exist "CLEO\NoFuel.ini"
then 0AF0: 31@ = read_int_from_ini_file "CLEO\NoFuel.ini" section "NoFuel" key "status"
else
    0AF1: write_int 1 to_ini_file "CLEO\NoFuel.ini" section "NoFuel" key "status"
    0AF0: 31@ = read_int_from_ini_file "CLEO\NoFuel.ini" section "NoFuel" key "status"       
end

SAMP.ReadSAMPMemory(1@,0x146E0,2)
SAMP.ReadSAMPMemory(2@,0x15970,2) 
SAMP.ReadSAMPMemory(3@,0xB2510,2)

while true
wait 0

    if 0ADC: test_cheat "FUEL"
    then
        if 31@ == 0
        then
            31@ = 1
            0AF1: write_int 1 to_ini_file "CLEO\NoFuel.ini" section "NoFuel" key "status"
            0ACD: show_text_highpriority "nofuel on" time 1000   
        else
            31@ = 0
            0AF1: write_int 0 to_ini_file "CLEO\NoFuel.ini" section "NoFuel" key "status"
            0ACD: show_text_highpriority "nofuel off" time 1000   
        end   
    end
    
    if 31@ == 1
    then   
        SAMP.WriteSAMPMemory(0x146E0,0xC390,2)
        SAMP.WriteSAMPMemory(0x15970,0xC390,2)
        SAMP.WriteSAMPMemory(0xB2510,0xC20400,2)       
        if Actor.Driving($PLAYER_ACTOR)
        then
            0@ = Actor.CurrentCar($PLAYER_ACTOR)
            046C: 1@ = car 0@ driver
            if 003A: 1@ == $PLAYER_ACTOR // (int)
            then
                0918: set_car 0@ engine_operation 1
            end
        end
    else   
        SAMP.WriteSAMPMemory(0x146E0,1@,2)
        SAMP.WriteSAMPMemory(0x15970,2@,2)
        SAMP.WriteSAMPMemory(0xB2510,3@,2)           
    end
    
end

004E: end_thread
 

Attachments

  • McarNoFuel.cs
    19.3 KB · Views: 12

dinoid

Member
Joined
Jan 1, 2022
Messages
13
Reaction score
1
Location
Brazil
try
PHP:
{$CLEO}
0000: NOP

wait 8500

if 0AAB: does_file_exist "CLEO\NoFuel.ini"
then 0AF0: 31@ = read_int_from_ini_file "CLEO\NoFuel.ini" section "NoFuel" key "status"
else
    0AF1: write_int 1 to_ini_file "CLEO\NoFuel.ini" section "NoFuel" key "status"
    0AF0: 31@ = read_int_from_ini_file "CLEO\NoFuel.ini" section "NoFuel" key "status"     
end

SAMP.ReadSAMPMemory(1@,0x146E0,2)
SAMP.ReadSAMPMemory(2@,0x15970,2)
SAMP.ReadSAMPMemory(3@,0xB2510,2)

while true
wait 0

    if 0ADC: test_cheat "FUEL"
    then
        if 31@ == 0
        then
            31@ = 1
            0AF1: write_int 1 to_ini_file "CLEO\NoFuel.ini" section "NoFuel" key "status"
            0ACD: show_text_highpriority "nofuel on" time 1000 
        else
            31@ = 0
            0AF1: write_int 0 to_ini_file "CLEO\NoFuel.ini" section "NoFuel" key "status"
            0ACD: show_text_highpriority "nofuel off" time 1000 
        end 
    end
  
    if 31@ == 1
    then 
        SAMP.WriteSAMPMemory(0x146E0,0xC390,2)
        SAMP.WriteSAMPMemory(0x15970,0xC390,2)
        SAMP.WriteSAMPMemory(0xB2510,0xC20400,2)     
        if Actor.Driving($PLAYER_ACTOR)
        then
            0@ = Actor.CurrentCar($PLAYER_ACTOR)
            046C: 1@ = car 0@ driver
            if 003A: 1@ == $PLAYER_ACTOR // (int)
            then
                0918: set_car 0@ engine_operation 1
            end
        end
    else 
        SAMP.WriteSAMPMemory(0x146E0,1@,2)
        SAMP.WriteSAMPMemory(0x15970,2@,2)
        SAMP.WriteSAMPMemory(0xB2510,3@,2)         
    end
  
end

004E: end_thread
Instant crash when joining a server. Btw, overwritting just "0x146E0" is enough for the servers I play.
The problem is when I disable the NOP and try to trigger the vehicle kick, the game crashes.
 
Status
Not open for further replies.
Top