CLEO Help Format crash

CLEO related
Status
Not open for further replies.

G0arafa

New member
Joined
Nov 13, 2016
Messages
2
Reaction score
0
Hi, i got crash when i use 
Code:
 0AF0: $a1 = get_int_from_ini_file "cleo\a.ini" section "Section" key "id"
$n2 = SAMP.GetPlayerNickname($a1)
format 16@ "%s (%d)" $n1 $n2
Dialog.ListBoxInsertElement(1@ ,99 , 16@, 1 ,15)
What should i do not to get crashed?
I get crashed when using the format 16@ "%s (%d)" $n1 $n2, but if i use 
Code:
Dialog.ListBoxInsertElement(1@ ,99 , $n1, 1 ,15)
Dialog.ListBoxInsertElement(1@ ,99 , $n2, 1 ,15)
don't get crash...
 

Hackz0r

Active member
Joined
Oct 31, 2016
Messages
25
Reaction score
0
you need to allocate memory if you want to format strings. example:

alloc 16@ 64
format 16@ "enough memory here for 64 characters"
//do things with the string
free 16@
 

G0arafa

New member
Joined
Nov 13, 2016
Messages
2
Reaction score
0
Ok, ty dude, and i have one more problem, when i use
Code:
:dox
alloc 18@ 128
SAMP.IsCommandTyped($abc)
format 18@ "%s" $abc
0AF5: write_string 18@ to_ini_file "cleo\a.ini" section "Section" key "String"
free 18@
0AF4: 31@v = read_string_from_ini_file "cleo\a.ini" section "Section" key "String"
chatmsg "%s" -1 31@v
SAMP.CmdRet()
read only 20 characters, who can to read more?
 
Status
Not open for further replies.
Top