CLEO Help 0A9A - Crash when using string for mode

CLEO related
Status
Not open for further replies.

Maskoo

Active member
Joined
Feb 20, 2013
Messages
37
Reaction score
0
Hi,

Using a string for the mode parameter instantly crashes the game.
The problem is that it only happens if I compiled the script.

For example, this script by springfield works just fine.
But if I open it and recompile it, without changing anything, it crashes in game.

Oddly enough, using a hex value instead of a string works just fine (eg: 0x6277 instead of "wt+")
I feel like it could be something related to my SannyBuilder or CLEO installation, but after trying out a few things, it still doesn't work...

I am using:
- CLEO 4.3.22
- Sanny Builder 3.3.1
- SAMP 0.3.7-R1

I already tried:
- Uninstalling and reinstalling everything, starting fresh
- CLEO 4.1.1.30
- SAMP 0.3.7-R2
- With or without SAMPFuncs data in /SannyBuilder/data/sa

Here's some examples:
This works:
Code:
{$CLEO .cs}

0000: NOP

0A9A: 0@ = openfile "CLEO/filename.txt" mode 0x6277
0A9B: closefile 0@
0A93: end_custom_thread

This crashes the game:
Code:
{$CLEO .cs}

0000: NOP

0A9A: 0@ = openfile "CLEO/filename.txt" mode "wt+"
0A9B: closefile 0@
0A93: end_custom_thread

This one crashes too:
Code:
{$CLEO .cs}

0000: NOP

0@ = File.Open("CLEO\filename.txt", "wt+")
File.Close(0@)
0A93: end_custom_thread
 
Last edited:

Maskoo

Active member
Joined
Feb 20, 2013
Messages
37
Reaction score
0
What the point of this?
Curiosity. I'm confused.
Trying to understand what's going wrong. Why is a script compiled by someone else work, but doesn't when I compile it even though I (suppose) have everything installed correctly.
Being able to compile scripts, without having to spend time to figure out why it's crashing in game when it really shouldn't.

To be honest I got curious about CLEO and decided to try learning a few things.
I noticed your Vehicle recording w/o SAMPFUNCS script and attempted to try and make it work with commands instead of cheat codes.
The script kept crashing. I thought it was something wrong with my edited code, but it turns out it was something stupid that shouldn't happen... Took me a few hours to realize the cause, and I still don't understand why it's happening.

Doesn't matter too much here because I can use 0x6277 instead of "wb+", since it works fine that way. But I'm afraid it could also happen with other commands, and that would just ruin all the fun.
 
Status
Not open for further replies.
Top