Help Endless loop bug (CLEO)

cailozma

Member
Joined
Jun 6, 2025
Messages
11
Reaction score
1
Hi, I have a headache and am about to go to the hospital. Please help me !!!
Why is it that when I press C+Q to start it is an endless loop?
I just want it to start once then stop and wait to press C+Q again to start again/ Help thank you
CSS:
{$CLEO .cs}

{$USE SAMPFUNCS}

Alloc($PLAYER_ACTOR, 3)

Alloc($PLAYER_CHAR, 2)



nop

wait 0

gosub @Noname_1922

3@ = 0

nop

gosub @Noname_1954



:Noname_29

wait 0

if and

  Pad.IsKeyPressed(KeyCode.C)

  Pad.IsKeyPressed(KeyCode.Q)

goto_if_false @Noname_29



:Noname_52

wait 0

if or

  Pad.IsKeyPressed(KeyCode.C)

  Pad.IsKeyPressed(KeyCode.Q)

goto_if_false @Noname_141

goto @Noname_52

if

  find_first_file "CLEO\*.cailozma" {var_handle} 12@ {var_fileName} "CLEO\test.cailozma"

goto_if_false @Noname_869

wait 0



:Noname_141

if

  0@ = File.Open("CLEO\test.cailozma", 25202)

goto_if_false @Noname_141

9@ = Clock.GetGameTimer()

Text.PrintStringNow("Start", 2500)

3@ = 0



:Noname_213

wait 0

gosub @Noname_1749

gosub @Noname_1976

gosub @Noname_2126

if and

  Pad.IsKeyPressed(KeyCode.C)

  Pad.IsKeyPressed(KeyCode.Q)

goto_if_false @Noname_264

goto @Noname_766



:Noname_264

$PLAYER_ACTOR = Player.GetChar($PLAYER_CHAR)

if and

  not Char.IsDead($PLAYER_ACTOR)

  Char.IsInAnyCar($PLAYER_ACTOR)

goto_if_false @Noname_796

2@ = Char.StoreCarIsInNoSave($PLAYER_ACTOR)

7@ = Memory.GetVehiclePointer(2@)

Car.SetCollision(2@, False)

if

  3@ == 2

goto_if_false @Noname_348

3@ = 0

goto @Noname_796



:Noname_348

if

  3@ == 3

goto_if_false @Noname_373

goto @Noname_141



:Noname_373

if

  3@ == 1

goto_if_false @Noname_412

Car.FreezePosition(2@, True)

gosub @Noname_921

goto @Noname_759



:Noname_412

Car.FreezePosition(2@, False)

15@ = File.Read(0@, 1)

10@ = File.Read(0@, 4)

gosub @Noname_854



:Noname_446

  is_int_lvar_greater_or_equal_to_int_lvar 10@ >= 8@

goto_if_false @Noname_500

gosub @Noname_854

gosub @Noname_1749

gosub @Noname_1976

gosub @Noname_2126

wait 0

goto @Noname_446



:Noname_500

if

  15@ == 6

goto_if_false @Noname_532

gosub @Noname_1527

goto @Noname_759



:Noname_532

if

  15@ == 0

goto_if_false @Noname_562

File.Close(0@)

goto @Noname_796



:Noname_562

if

  15@ == 1

goto_if_false @Noname_594

gosub @Noname_935

goto @Noname_759



:Noname_594

if

  15@ == 16

goto_if_false @Noname_626

gosub @Noname_1715

goto @Noname_759



:Noname_626

if

  15@ == 2

goto_if_false @Noname_656

File.Close(0@)

goto @Noname_141



:Noname_656

if

  15@ == 3

goto_if_false @Noname_688

gosub @Noname_1026

goto @Noname_759



:Noname_688

if

  15@ == 4

goto_if_false @Noname_720

gosub @Noname_1253

goto @Noname_759



:Noname_720

if

  15@ == 5

goto_if_false @Noname_752

gosub @Noname_1135

goto @Noname_759



:Noname_752

gosub @Noname_899



:Noname_759

goto @Noname_213



:Noname_766

wait 0

if or

  Pad.IsKeyPressed(KeyCode.C)

  Pad.IsKeyPressed(KeyCode.Q)

goto_if_false @Noname_796

goto @Noname_766



:Noname_796

Car.FreezePosition(2@, True)

Car.FreezePosition(2@, False)

Text.PrintStringNow("Stop", 2500)

Car.SetCollision(2@, True)

File.Close(0@)

gosub @Noname_1954

goto @Noname_29



:Noname_854

8@ = Clock.GetGameTimer()

sub_int_lvar_from_int_lvar 8@ -= 9@

return



:Noname_869

Text.PrintStringNow("Cannot find File", 2500)

goto @Noname_29



:Noname_899

Text.PrintStringNow("UNIKNOW vType", 1500)

return



:Noname_921

Text.PrintStringNow("Paused", 1)

return



:Noname_935

4@ = File.Read(0@, 12)

int_add 13@ = 7@ + 20

14@ = Memory.Read(13@, 4, False)

14@ += 48

Memory.Write(14@, 4, 4@, True)

14@ += 4

Memory.Write(14@, 4, 5@, True)

14@ += 4

Memory.Write(14@, 4, 6@, True)

return



:Noname_1026

4@ = File.Read(0@, 12)

int_add 13@ = 7@ + 20

14@ = Memory.Read(13@, 4, False)

14@ += 48

Memory.Write(14@, 4, 4@, True)

14@ += 4

Memory.Write(14@, 4, 5@, True)

14@ += 4

Memory.Write(14@, 4, 6@, True)

11@ = File.Read(0@, 4)

Car.SetHeading(2@, 11@)

return



:Noname_1135

4@ = File.Read(0@, 12)

int_add 13@ = 7@ + 20

14@ = Memory.Read(13@, 4, False)

14@ += 48

Memory.Write(14@, 4, 4@, True)

14@ += 4

Memory.Write(14@, 4, 5@, True)

14@ += 4

Memory.Write(14@, 4, 6@, True)

16@ = File.Read(0@, 16)

Car.SetQuaternion(2@, 16@, 17@, 18@, 19@)

return



:Noname_1253

4@ = File.Read(0@, 12)

int_add 13@ = 7@ + 20

14@ = Memory.Read(13@, 4, False)

14@ += 48

Memory.Write(14@, 4, 4@, True)

14@ += 4

Memory.Write(14@, 4, 5@, True)

14@ += 4

Memory.Write(14@, 4, 6@, True)

16@ = File.Read(0@, 1)

if

  is_local_var_bit_set_const 16@ {bitIndex} 0

goto_if_false @Noname_1395

int_add 13@ = 7@ + 1180

Memory.Write(13@, 4, 1.0, True)



:Noname_1395

if

  is_local_var_bit_set_const 16@ {bitIndex} 1

goto_if_false @Noname_1438

int_add 13@ = 7@ + 1184

Memory.Write(13@, 4, 1.0, True)



:Noname_1438

if

  is_local_var_bit_set_const 16@ {bitIndex} 2

goto_if_false @Noname_1498

int_add 13@ = 7@ + 1064

16@ = Memory.Read(13@, 4, True)

set_local_var_bit_const 16@ {bitIndex} 5

Memory.Write(13@, 4, 16@, True)



:Noname_1498

16@ = File.Read(0@, 16)

Car.SetQuaternion(2@, 16@, 17@, 18@, 19@)

return



:Noname_1527

4@ = File.Read(0@, 12)

int_add 13@ = 7@ + 20

14@ = Memory.Read(13@, 4, False)

14@ += 48

Memory.Write(14@, 4, 4@, True)

14@ += 4

Memory.Write(14@, 4, 5@, True)

14@ += 4

Memory.Write(14@, 4, 6@, True)

4@ = File.Read(0@, 12)

int_add 13@ = 7@ + 68

Memory.Write(13@, 4, 4@, True)

13@ += 4

Memory.Write(13@, 4, 5@, True)

13@ += 4

Memory.Write(13@, 4, 6@, True)

16@ = File.Read(0@, 16)

Car.SetQuaternion(2@, 16@, 17@, 18@, 19@)

return



:Noname_1715

16@ = File.Read(0@, 16)

if

14@ = Samp.GetBaseAddress()

goto_if_false @Noname_1747

Samp.SendChatMsg(16@v)



:Noname_1747

return



:Noname_1749

Text.UseCommands(True)

Hud.SetSpritesDrawBeforeFade(True)

Hud.DrawSprite(1, 320.0, 400.0, 320.0, 40.0, 255, 255, 255, 255)

Text.SetRightJustify(True)

Text.SetColor(255, 255, 255, 128)

Text.SetDropshadow(1, 32, 32, 32, 128)

Text.DisplayWithNumber(447.0, 394.0, 'NUMBER', 8@)

31@ += 8.0

TIMERA += 8.0

Hud.DrawSprite(2, 31@, TIMERA, 16.0, 16.0, 255, 255, 255, 255)

31@ -= 8.0

TIMERA -= 8.0

return



:Noname_1922

Txd.LoadDictionary("MGD")

Txd.LoadSprite(1, "interf")

Txd.LoadSprite(2, "mouse")

return



:Noname_1954

31@ = 320.0

TIMERA = 224.0

return



:Noname_1976

16@, 17@ = Mouse.GetMovement()

add_float_lvar_to_float_lvar 31@ += 16@

sub_float_lvar_from_float_lvar TIMERA -= 17@

if

  31@ < 0.0

goto_if_false @Noname_2031

31@ = 0.0



:Noname_2031

if

  TIMERA < 0.0

goto_if_false @Noname_2062

TIMERA = 0.0



:Noname_2062

if

  31@ > 640.0

goto_if_false @Noname_2093

31@ = 640.0



:Noname_2093

if

  TIMERA > 448.0

goto_if_false @Noname_2124

TIMERA = 448.0



:Noname_2124

return



:Noname_2126

if

  Pad.IsButtonPressed(PadId.Pad1, Button.Circle)

goto_if_false @Noname_2344

if and

  TIMERA > 386.0

  TIMERA < 414.0

goto_if_false @Noname_2320

if and

  31@ > 167.0

  31@ < 214.0

goto_if_false @Noname_2244

if

  3@ == 0

goto_if_false @Noname_2237

3@ = 1

goto @Noname_2244



:Noname_2237

3@ = 0



:Noname_2244

if and

  31@ > 222.0

  31@ < 268.0

goto_if_false @Noname_2282

3@ = 2



:Noname_2282

if and

  31@ > 277.0

  31@ < 324.0

goto_if_false @Noname_2320

3@ = 3



:Noname_2320

  Pad.IsButtonPressed(PadId.Pad1, Button.Circle)

goto_if_false @Noname_2344

wait 0

goto @Noname_2320



:Noname_2344

return
 
Top