Hello, I have a problem with the text setting dialogs for the /au1 command, I can set up to 100 characters maximum in one, and if I set more than 100 characters, the game crashes and I don't understand why, I I tried to increase its memory, to change the variables and in vain, still 100 characters is the maximum. Please help me!
The code for the text setting dialogs directly via the /au1 command in the game:
if 0B3C: samp is_dialog_responded id 7000 button $BUTTON list_item $LIST_ITEM input_text 0
then
if $BUTTON == 1
then
0AC8: $Competition_Automobiles_Set = allocate_memory_size 1024
if $LIST_ITEM == 0
then
0BFC: set_global_var "SELECTEDROW" = 1
0AD3: $Competition_Automobiles_Set = "{00FFFF}Enter below the text you want to set to Answer_au1%c%cThe text cannot exceed 109 characters" 0xA 0xA
0B3B: samp show_dialog id 7001 caption "{C2A2DA}(ES Helper) {00FFFF}Set to Answer_au1" text $Competition_Automobiles_Set button_1 "Set" button_2 "Close" style 1
end
if $LIST_ITEM == 1
then
0BFC: set_global_var "SELECTEDROW" = 2
0AD3: $Competition_Automobiles_Set = "{00FFFF}Enter below the text you want to set to Question_au1%c" 0xA
0AD3: $Competition_Automobiles_Set = "%sThe text must have a minimum of 5 and a maximum of 109 characters" $Competition_Automobiles_Set
0B3B: samp show_dialog id 7001 caption "{C2A2DA}ES Helper {FFFFFF}Set to Question_au1" text $Competition_Automobiles_Set button_1 "Set" button_2 "Close" style 1
end
else 0B47: samp close_current_dialog_with_button 0
end
end
if 0B3C: samp is_dialog_responded id 7001 button $BUTTON list_item $LIST_ITEM input_text 0
then
if $BUTTON == 1
then
0AC8: $Competition_Automobiles_Set = allocate_memory_size 1024
0C11: memset destination $Competition_Automobiles_Set value 0 size 1024
0B4A: samp $Competition_Automobiles_Set = get_current_dialog_editbox_text
0C17: 1@ = strlen $Competition_Automobiles_Set
0BFD: 2@ = get_global_var "SELECTEDROW"
0A8D: 3@ = read_memory $Competition_Automobiles_Set size 1 virtual_protect 1
if and
1@ >= 5
1@ <= 109
then
if 2@ == 1
then
0AF5: write_string $Competition_Automobiles_Set to_ini_file "CLEO\ESHelp - CMD (News Reporters).ini" section "Competition-Cars" key "Answer_Au1"
chatmsg "{C2A2DA}ES Helper {FFFFFF}The text on Answer_au1 has been successfully set." -1
end
if 2@ == 2
then
0AF5: write_string $Competition_Automobiles_Set to_ini_file "CLEO\ESHelp - CMD (News Reporters).ini" section "Competition-Cars" key "Question_Au1"
chatmsg "{C2A2DA}ES Helper {FFFFFF}The text on Question_au1 has been successfully set." -1
end
else
if 2@ == 1
then
0AD3: $Competition_Automobiles_Set = "{FFFFFF}Enter below the text you want to set to Answer_au1%c%c" 0xA 0xA
0AD3: $Competition_Automobiles_Set = "%sThe text must have a minimum of 5 and a maximum of 109 characters" $Competition_Automobiles_Set
0B3B: samp show_dialog id 7001 caption "{FFFFFF}({C2A2DA}ES Helper{FFFFFF}) Set to Answer_au1:" text $Competition_Automobiles_Set button_1 "Set" button_2 "Close" style 1
end
if and
2@ == 2
3@ <> 45
then
0AD3: $Competition_Automobiles_Set = "{FFFFFF}Enter below the text you want to set to Question_au1%c" 0xA
0B3B: samp show_dialog id 7001 caption "{FFFFFF}({C2A2DA}ES Helper{FFFFFF}) Set to Question_au1:" text $Competition_Automobiles_Set button_1 "Set" button_2 "Close" style 1
end
end
0AC9: free_allocated_memory $Competition_Automobiles_Set
else 0B47: samp close_current_dialog_with_button 0
end
end
The code for the text setting dialogs directly via the /au1 command in the game:
if 0B3C: samp is_dialog_responded id 7000 button $BUTTON list_item $LIST_ITEM input_text 0
then
if $BUTTON == 1
then
0AC8: $Competition_Automobiles_Set = allocate_memory_size 1024
if $LIST_ITEM == 0
then
0BFC: set_global_var "SELECTEDROW" = 1
0AD3: $Competition_Automobiles_Set = "{00FFFF}Enter below the text you want to set to Answer_au1%c%cThe text cannot exceed 109 characters" 0xA 0xA
0B3B: samp show_dialog id 7001 caption "{C2A2DA}(ES Helper) {00FFFF}Set to Answer_au1" text $Competition_Automobiles_Set button_1 "Set" button_2 "Close" style 1
end
if $LIST_ITEM == 1
then
0BFC: set_global_var "SELECTEDROW" = 2
0AD3: $Competition_Automobiles_Set = "{00FFFF}Enter below the text you want to set to Question_au1%c" 0xA
0AD3: $Competition_Automobiles_Set = "%sThe text must have a minimum of 5 and a maximum of 109 characters" $Competition_Automobiles_Set
0B3B: samp show_dialog id 7001 caption "{C2A2DA}ES Helper {FFFFFF}Set to Question_au1" text $Competition_Automobiles_Set button_1 "Set" button_2 "Close" style 1
end
else 0B47: samp close_current_dialog_with_button 0
end
end
if 0B3C: samp is_dialog_responded id 7001 button $BUTTON list_item $LIST_ITEM input_text 0
then
if $BUTTON == 1
then
0AC8: $Competition_Automobiles_Set = allocate_memory_size 1024
0C11: memset destination $Competition_Automobiles_Set value 0 size 1024
0B4A: samp $Competition_Automobiles_Set = get_current_dialog_editbox_text
0C17: 1@ = strlen $Competition_Automobiles_Set
0BFD: 2@ = get_global_var "SELECTEDROW"
0A8D: 3@ = read_memory $Competition_Automobiles_Set size 1 virtual_protect 1
if and
1@ >= 5
1@ <= 109
then
if 2@ == 1
then
0AF5: write_string $Competition_Automobiles_Set to_ini_file "CLEO\ESHelp - CMD (News Reporters).ini" section "Competition-Cars" key "Answer_Au1"
chatmsg "{C2A2DA}ES Helper {FFFFFF}The text on Answer_au1 has been successfully set." -1
end
if 2@ == 2
then
0AF5: write_string $Competition_Automobiles_Set to_ini_file "CLEO\ESHelp - CMD (News Reporters).ini" section "Competition-Cars" key "Question_Au1"
chatmsg "{C2A2DA}ES Helper {FFFFFF}The text on Question_au1 has been successfully set." -1
end
else
if 2@ == 1
then
0AD3: $Competition_Automobiles_Set = "{FFFFFF}Enter below the text you want to set to Answer_au1%c%c" 0xA 0xA
0AD3: $Competition_Automobiles_Set = "%sThe text must have a minimum of 5 and a maximum of 109 characters" $Competition_Automobiles_Set
0B3B: samp show_dialog id 7001 caption "{FFFFFF}({C2A2DA}ES Helper{FFFFFF}) Set to Answer_au1:" text $Competition_Automobiles_Set button_1 "Set" button_2 "Close" style 1
end
if and
2@ == 2
3@ <> 45
then
0AD3: $Competition_Automobiles_Set = "{FFFFFF}Enter below the text you want to set to Question_au1%c" 0xA
0B3B: samp show_dialog id 7001 caption "{FFFFFF}({C2A2DA}ES Helper{FFFFFF}) Set to Question_au1:" text $Competition_Automobiles_Set button_1 "Set" button_2 "Close" style 1
end
end
0AC9: free_allocated_memory $Competition_Automobiles_Set
else 0B47: samp close_current_dialog_with_button 0
end
end