Salutare, mi-am facut acest cleo prin care pot scrie o propozitie in .ini, iar apoi sa o trimit in mai multe locuri cu o singura comanda.
Functioneaza, dar in momentul in care folosesc /changetext pentru a scrie in .ini, si propozitia trece de 95-100 de caractere, iau crash.
Cum pot face sa verific numarul de caractere al propozitiei? (spre exemplu, daca propozitia are peste 95 de caractere, sa nu imi dea voie sa o adaug in .ini)
{$CLEO .cs}
{$USE ini}
0662: "Cleo Script"
thread "Scriu chestii"
wait 2500
0B34: samp register_client_command "text" to_label @Text
0B34: samp register_client_command "send" to_label @Send
0B34: samp register_client_command "changetext" to_label @ChangeText
:Text
0AC8: 19@ = allocate_memory_size 260
0AF4: 19@ = read_string_from_ini_file "CLEO\CustomCleo.ini" section "Text" key "chat"
chatmsg "======================================" -1
chatmsg "Textul tau salvat este:"
chatmsg 19@ -1
chatmsg "======================================" -1
free 19@
cmdret
:Send
SAMP.IsCommandTyped(19@)
0AC8: 19@ = allocate_memory_size 260
0AF4: 19@ = read_string_from_ini_file "CLEO\CustomCleo.ini" section "Text" key "chat"
0AF9: samp say_msg "/ad %s" 19@
0AF9: samp say_msg "%s" 19@
0AF9: samp say_msg "/vip %s" 19@
free 19@
cmdret
:ChangeText
if SAMP.IsCommandTyped(0@)
then
0AF5: write_string 0@ to_ini_file "cleo\CustomCleo.ini" section "Text" key "chat"
chatmsg "{00FF00}Textul %s {FFFFFF} a fost salvat in CustomCleo.ini." -1 0@
else
chatmsg "{FFFFFF}Use: /changetext <text>" -1
end
SAMP.CmdRet