You are not logged in.
Pages: 1
Hi, I am using the following code to display text without editing the file .GXT or create files .FXT.
... gosub @SubStrings wait 5000 0AA5: call 0x588BE0 num_params 4 pop 4 0 0 0 1@ ... :SubStrings 0A9F: 1@ = current_thread_pointer 1@ += 0x10 0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0 1@ -= @SubMsgWelcome 1@ += 4 return :SubMsgWelcome 0900: "Welcome to blablabla..." jump @SubMsgEnd :SubMsgUsage 0900: "Press ~h~~k~~PED_ANSWER_PHONE~~w~ + ~h~~k~~PED_FIREWEAPON~~w~ to blablabla..." :SubMsgEnd 0000: NOP
Well, the code works correctly, but the problem is that the text is displayed in game all in UPPERCASE mode and I not want this. Is there a way to solve this problem???
Thanks!
Offline
Go to Sanny's Options-Format-Case converting and set this option to 'As Is'. SB won't convert the strings to uppercase anymore.
Offline
OK, Thanks. I have another problem now!
. Is the same code but optimized.
{$CLEO}
thread 'TEST'
wait 5000
1@ = 0
gosub @SubStrings //DISPLAY THE 1ST MESSAGE
wait 5000
1@ = 1
gosub @SubStrings //DISPLAY THE 2ND MESSAGE
:LabelControls
...
:SubStrings
0A9F: 2@(1@,2i) = current_thread_pointer
2@(1@,2i) += 0x10
0A8D: 2@(1@,2i) = read_memory 2@(1@,2i) size 4 virtual_protect 0
if
1@ == 0
jf @SubStrings02
3@ = @SubMsgWelcome
jump @SubStrings03
:SubStrings02
3@ = @SubMsgUsage
:SubStrings03
0062: 2@(1@,2i) -= 3@
2@(1@,2i) += 4
0AA5: call 0x588BE0 num_params 4 pop 4 0 0 0 2@(1@,2i)
return
:SubMsgWelcome
0900: "Welcome to blablabla..."
jump @SubMsgEnd
:SubMsgUsage
0900: "Press ~h~~k~~PED_ANSWER_PHONE~~w~ + ~h~~k~~PED_FIREWEAPON~~w~ to blablabla..."
:SubMsgEnd
0000: NOPI created an array to facilitate the use of the messages. The first msg is diplayed correctly, but in the second msg the game crashes! Is the array index that is wrong or what?
Offline
Try this:
{$CLEO}
thread 'TEST'
wait 5000
0AB1: call_scm_func @SubStrings 1 @String1 //DISPLAY THE 1ST MESSAGE
wait 5000
0AB1: call_scm_func @SubStrings 1 @String2 //DISPLAY THE 2ND MESSAGE
wait 5000
0AB1: call_scm_func @SubStrings 1 @String3 //DISPLAY THE 3RD MESSAGE
0A93: end_custom_thread
:SubStrings // do not edit this routine, only strings below
0A9F: 1@ = current_thread_pointer
1@ += 0x10
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ -= 0@ // 0@ is the label @StringN
1@ += 4
0AA5: call 0x588BE0 num_params 4 pop 4 0 0 0 1@
0AB2: ret 0
:String1
0900: "Welcome to blablabla..."
:String2
0900: "Press ~h~~k~~PED_ANSWER_PHONE~~w~ + ~h~~k~~PED_FIREWEAPON~~w~ to blablabla..."
:String3
0900: "Another blahblahblah"
0000: null_termitator
Offline
THANKS A LOT MAN!!! Only one more question: Can I add as many messages I want with this method?
Last edited by Rapier (28-06-2008 20:28)
Offline
Yes, as many as you want
:String3 0900: "Another blahblahblah" :String4 0900: "Another blahblahblah" :String5 0900: "Another blahblahblah" ...
Offline
OK, thanks again!
Offline
Pages: 1