KamikazeSripterul
Well-known member
- Joined
- Jun 30, 2019
- Messages
- 353
- Reaction score
- 23
So I've done this code, with the help of one of the members of this community, BUT it doesn't work rlly well and it crashes. I'm not sure if i need to allocate any memory or anything. Can someone help?
--> Here's some videos to show the problem
- /balance (it writes the right value in .ini file but crashes) https://streamable.com/fpsj0
- /transfer (it writes the whole string to .ini file and it crashes) https://streamable.com/lttmv
Here's the code
-->
--> Here's some videos to show the problem
- /balance (it writes the right value in .ini file but crashes) https://streamable.com/fpsj0
- /transfer (it writes the whole string to .ini file and it crashes) https://streamable.com/lttmv
Here's the code
-->
Code:
While true
wait 0
alloc 2@ 260
0B75: samp get_chat_string 99 text_to 2@ prefix_to 3@ color_to 4@ prefix_color_to 5@
if or
4@ == 0xffffd700
4@ == 0xff4dad2b
then
if or
0C29: $not_used = strstr string1 2@ string2 "Your account balance is now"
0C29: $not_used = strstr string1 2@ string2 "Your current bank account balance is:"
then
0AB1: @GetText 1 WriteStringPointer 2@ rnt 15@
0AF5: write_string 15@ to_ini_file "cleo\ServerCMD.ini" section "Bank" key "balance"
chatmsg "{000089}[{770089}Bank Manager{000089}]: {e0388f}Account Balance Changed."
chatmsg "{000089}[{770089}Bank Manager{000089}]: {e0388f}You can check your new balance using {ffffff}[/bankmenu] {e0388f}> {ffffff}Check your balance"
wait 1000
end
end
free 2@
END
:GetText
{
0AB1: @GetText 1 WriteStringPointer 0@ rnt 1@
}
0C17: 31@ = strlen 0@
31@ -= 1
for 30@ = 0 to 31@
0A8D: 29@ = read_memory 0@ size 1 virtual_protect 1
if
29@ == 36 // 36 = $
then
0@++
0AB2: ret 1 0@
end
0@++
end
0AB2: ret 0