Quantcast

Jump to content

» «
Photo

[SA] Call Method Problem

4 replies to this topic
Marty McFlaY
  • Marty McFlaY

    If you cant run, then walk, if you cant walk, then crawl :)

  • Members
  • Joined: 25 Feb 2016
  • England

#1

Posted 3 days ago

Hi,

 

Since there is a memory address of printing string which is 

0x71A700

I have taken the memory address from dk22pac game_sa. I'm really confused right now. I manage to add text in the text box by taking his memory address and executing it with "0AA5" opcode but this ^^ memory address first asks for x,y position and then text. I don't know how to do it but someone can please help me. I'm not really good at memories and call functions.

 

Here is my code:

{$CLEO .cs}
0000:

:pa
wait 0   
[email protected] = 320.0 
[email protected] = 224.0
0AA5: call 0x71A700 num_params 1 pop 1 "PROFESSIONAL"
0AA7: call_function 0x71A700 num_params 2 pop 2 [email protected] [email protected] [email protected]


0A93: end_custom_thread

Please don't think of not replying because of elaboration. I don't need any detail or explanation of call function. You can simply post the working snippet if you don't like to elaborate things. If yes then I will appreciate it. 

 


guru_guru
  • guru_guru

    pajaro culiao

  • Members
  • Joined: 22 Jul 2017
  • Chile

#2

Posted 3 days ago

void __cdecl CFont::PrintString(float x, float y, char *str)

I guess this could work.

 

Probably.

string_buffer:
hex
"see nice string"
end

0AC6: get_label_pointer @string_buffer store_to [email protected]
0AA5: call_function 0x71A700 num_params 3 pop 3 320.0 224.0 [email protected]

Marty McFlaY
  • Marty McFlaY

    If you cant run, then walk, if you cant walk, then crawl :)

  • Members
  • Joined: 25 Feb 2016
  • England

#3

Posted 3 days ago

Crash.


Sanmodder
  • Sanmodder

    Fan script

  • Members
  • Joined: 11 Sep 2017
  • Poland

#4

Posted 3 days ago Edited by Sanmodder, 3 days ago.

Crash.

crash game because after compiling this error goes out
yes, this is how sa_scr opcodes is used

hex
  73 65 65 20 6E 69 63 65 20 73 74 72 69 6E 67
end
0AC6: -2 = label 3 @ offset
0AA5: call 7448320 num_params 3 pop 3 320.0 224.0 3

replace it
: strings
hex
  73 65 65 20 6E 69 63 65 20 73 74 72 69 6E 67
end
0AC6: 3 @ = label @strings offset
0AA5: call 7448320 num_params 3 pop 3 320.0 224.0 3

 

////////////////////////////////////////////////////////////////////////////////////////////////////

and you still have a freze game because buffer must be
hidden
goto
@next

:strings
hex
   73 65 65 20 6E 69 63 65 20 73 74 72 69 6E 67
end


: next
0AC6: 3 @ = label @strings offset
0AA5: call 7448320 num_params 3 pop 3 320.0 224.0 3

and how is it to show you text from, buffer


DK22Pac
  • DK22Pac

  • Feroci
  • Joined: 12 Apr 2009
  • Ukraine
  • Best Conversion 2017 Contribution [Liberty City Stories: PC]
    Best WIP Mod 2014 [Grand Theft Auto 3D Contribution]
    Contribution Award [Mods]
    Helpfulness Award [Mods]

#5

Posted 3 days ago

`CFont::PrintString` may 'print' (render) directly into framebuffer, so it won't work if you call it from script.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users