casshem Posted February 3, 2012 Share Posted February 3, 2012 (edited) Hello there; I'm new to coding and would like to know how you would go about coding the text around your radar like in this picture: Thank you very much for helping me out. Edited February 3, 2012 by casshem Link to comment Share on other sites More sharing options...
Deji Posted February 3, 2012 Share Posted February 3, 2012 Step 1: Learn how to draw text. Step 2: Oh.. there is no step 2... Link to comment Share on other sites More sharing options...
casshem Posted February 3, 2012 Author Share Posted February 3, 2012 And how would I learn to read the memory for the information pertaining to my character? Link to comment Share on other sites More sharing options...
Deji Posted February 3, 2012 Share Posted February 3, 2012 So you don't need help drawing the text, you need help getting the information to draw? Shoulda started with that... What are you coding in? Have you already started the code? If so, please post it. Link to comment Share on other sites More sharing options...
casshem Posted February 3, 2012 Author Share Posted February 3, 2012 I'm trying to learn cleo to do this, but all the tutorials I've been sifting through don't deal with displaying character information. Link to comment Share on other sites More sharing options...
Frank.s Posted February 3, 2012 Share Posted February 3, 2012 (edited) Edit: Didn't see your last post before. What info do you want to get via coding about the player? Edited February 3, 2012 by Frank.s Link to comment Share on other sites More sharing options...
casshem Posted February 3, 2012 Author Share Posted February 3, 2012 I want to read and draw text information of the player's zone, money, health and armor. I'd like to also get the 'world' time as well. Pretty much everything that I posted in that picture. Link to comment Share on other sites More sharing options...
Frank.s Posted February 3, 2012 Share Posted February 3, 2012 (edited) Ah ok, you'll probably like Sanny Builders Opcode Search Tool (ctrl + alt + 2) I want to read and draw text information of the player's zoneYou can get the zone names from the info.zon0154: actor $PLAYER_ACTOR in_zone 'EASB' // Easter Basin money 010B: [email protected] = player $PLAYER_CHAR money health 0226: $6459 = actor [email protected] health armor 04DD: $9594 = actor $PLAYER_ACTOR armour I'd like to also get the 'world' time as well 00BF: $TIME_HOURS = current_time_hours, $TIME_MINS = current_time_minutes Edited February 3, 2012 by Frank.s Link to comment Share on other sites More sharing options...
casshem Posted February 3, 2012 Author Share Posted February 3, 2012 Wow, thanks! I'm going to try and get started on the code and see how it goes. Link to comment Share on other sites More sharing options...
Frank.s Posted February 3, 2012 Share Posted February 3, 2012 Glad to help. The first one is a "conditional check" so it's layed out like this: :ThreadLabel_1000001: wait 0 ms 00D6: if0154: actor $PLAYER_ACTOR in_zone 'EASB' // Easter Basin004D: jump_if_false @ThreadLabel_100 //Do something here. Link to comment Share on other sites More sharing options...
Ify24 Posted February 3, 2012 Share Posted February 3, 2012 Ok, and now how to draw it ? Link to comment Share on other sites More sharing options...
Deji Posted February 3, 2012 Share Posted February 3, 2012 Ok, and now how to draw it ? This is not your topic. Link to comment Share on other sites More sharing options...
Ify24 Posted February 3, 2012 Share Posted February 3, 2012 Ok, and now how to draw it ? This is not your topic. So ? Do I need to open new topic for a same question ? I am just asking... Link to comment Share on other sites More sharing options...
Link2012 Posted February 3, 2012 Share Posted February 3, 2012 033E: set_draw_text_position 320.0 180.333 GXT 'BJ_PUSH' // Push045A: draw_text_1number 320.0 155.333 GXT 'ALLRACE' number [email protected] // ALL RACES WON!~n~~w~$~1~045B: draw_text_2numbers 320.0 390.0 GXT 'TIME' numbers $TIME_MINS $6228 // ~1~:~1~ Link to comment Share on other sites More sharing options...
Ify24 Posted February 3, 2012 Share Posted February 3, 2012 033E: set_draw_text_position 320.0 180.333 GXT 'BJ_PUSH' // Push045A: draw_text_1number 320.0 155.333 GXT 'ALLRACE' number [email protected] // ALL RACES WON!~n~~w~$~1~045B: draw_text_2numbers 320.0 390.0 GXT 'TIME' numbers $TIME_MINS $6228 // ~1~:~1~ Yeah, whit these opcodes you draw text... but how to draw player health ? Link to comment Share on other sites More sharing options...
Link2012 Posted February 3, 2012 Share Posted February 3, 2012 033E: set_draw_text_position 320.0 180.333 GXT 'BJ_PUSH' // Push045A: draw_text_1number 320.0 155.333 GXT 'ALLRACE' number [email protected] // ALL RACES WON!~n~~w~$~1~045B: draw_text_2numbers 320.0 390.0 GXT 'TIME' numbers $TIME_MINS $6228 // ~1~:~1~ Yeah, whit these opcodes you draw text... but how to draw player health ? 0226: [email protected] = actor $PLAYER_ACTOR health045A: draw_text_1number 95.0 375.0 GXT 'NUMBER' number [email protected] // 'NUMBER' GXT Entry is "~1~". So in GXT Text '~1~' means NUMBER Link to comment Share on other sites More sharing options...
Ify24 Posted February 3, 2012 Share Posted February 3, 2012 033E: set_draw_text_position 320.0 180.333 GXT 'BJ_PUSH' // Push045A: draw_text_1number 320.0 155.333 GXT 'ALLRACE' number [email protected] // ALL RACES WON!~n~~w~$~1~045B: draw_text_2numbers 320.0 390.0 GXT 'TIME' numbers $TIME_MINS $6228 // ~1~:~1~ Yeah, whit these opcodes you draw text... but how to draw player health ? 0226: [email protected] = actor $PLAYER_ACTOR health045A: draw_text_1number 95.0 375.0 GXT 'NUMBER' number [email protected] // 'NUMBER' GXT Entry is "~1~". So in GXT Text '~1~' means NUMBER Thanks, but it draws 149 and when I loss health its stil 149... Link to comment Share on other sites More sharing options...
Silent Posted February 3, 2012 Share Posted February 3, 2012 Thought about looping it? Link to comment Share on other sites More sharing options...
casshem Posted February 4, 2012 Author Share Posted February 4, 2012 Did you figure out how to get it to update? Link to comment Share on other sites More sharing options...
Ify24 Posted February 4, 2012 Share Posted February 4, 2012 Yes. Whit looping. Link to comment Share on other sites More sharing options...
casshem Posted February 5, 2012 Author Share Posted February 5, 2012 (edited) :Health0342: enable_text_draw_centered 1033F: set_text_draw_letter_size 0.4 1.1081C: draw_text_outline 1 RGBA 0 0 0 2550340: set_text_draw_RGBA 255 255 255 255 0226: [email protected] = actor $PLAYER_ACTOR health045A: draw_text_1number 35.0 335.0 GXT 'NUMBER' number [email protected] // 'NUMBER' GXT Entry is "~1~". So in GXT Text '~1~' means NUMBERJump @Health:Armor0342: enable_text_draw_centered 1033F: set_text_draw_letter_size 0.4 1.1081C: draw_text_outline 1 RGBA 0 0 0 2550340: set_text_draw_RGBA 255 255 255 255 0226: [email protected] = actor $PLAYER_ACTOR armour045A: draw_text_1number 154.0 335.0 GXT 'NUMBER' number [email protected] // 'NUMBER' GXT Entry is "~1~". So in GXT Text '~1~' means NUMBERJump @Armor Okay, that's what I have so far for HP and Armor, but I'm not sure if: 1. I have to use @164 for HP and 2. @165 is okay for Armor. Also, if I just paste that into a .cs file, it won't run, right? Could I just put this at the beginning of the script to make it run: gosub @Health gosub @Armor Edited February 5, 2012 by casshem Link to comment Share on other sites More sharing options...
Link2012 Posted February 5, 2012 Share Posted February 5, 2012 (edited) Ok, reedited It should work, but put a variable below of [email protected] and instead of a jump put a return: :LOOPwait 0gosub @Healthgosub @Armorjump @LOOP:Health0342: enable_text_draw_centered 1033F: set_text_draw_letter_size 0.4 1.1081C: draw_text_outline 1 RGBA 0 0 0 2550340: set_text_draw_RGBA 255 255 255 2550226: [email protected] = actor $PLAYER_ACTOR health045A: draw_text_1number 35.0 335.0 GXT 'NUMBER' number [email protected] // 'NUMBER' GXT Entry is "~1~". So in GXT Text '~1~' means NUMBERreturn:Armor0342: enable_text_draw_centered 1033F: set_text_draw_letter_size 0.4 1.1081C: draw_text_outline 1 RGBA 0 0 0 2550340: set_text_draw_RGBA 255 255 255 2550226: [email protected] = actor $PLAYER_ACTOR armour045A: draw_text_1number 154.0 335.0 GXT 'NUMBER' number [email protected] // 'NUMBER' GXT Entry is "~1~". So in GXT Text '~1~' means NUMBERreturn Make sure if it's not writing various texts, if yes, remove it before update. You can do too a system to update only if the values change. Edited February 5, 2012 by Link2012 Link to comment Share on other sites More sharing options...
casshem Posted February 5, 2012 Author Share Posted February 5, 2012 (edited) Very awesome of you! Thank you very much mate I'll work on the money and time thing, which should be easy if it follows the format I used for Armor and HP. [Edit]: This doesn't work at all :[email protected] = Player.Money($PLAYER_CHAR)0342: enable_text_draw_centered 1 033F: set_text_draw_letter_size 0.4 1.1 081C: draw_text_outline 1 RGBA 0 0 0 255 0340: set_text_draw_RGBA 255 255 255 255 045A: draw_text_1number 400.0 300.0 GXT 'NUMBER' number [email protected] // ~1~return This also just crashes SA:MP on startup: :LOOPwait 0gosub @Healthgosub @Armorjump @LOOP:Health0342: enable_text_draw_centered 1033F: set_text_draw_letter_size 0.4 1.1081C: draw_text_outline 1 RGBA 0 0 0 2550340: set_text_draw_RGBA 255 255 255 2550226: [email protected] = actor $PLAYER_ACTOR health045A: draw_text_1number 35.0 335.0 GXT 'NUMBER' number [email protected] // 'NUMBER' GXT Entry is "~1~". So in GXT Text '~1~' means NUMBERreturn:Armor0342: enable_text_draw_centered 1033F: set_text_draw_letter_size 0.4 1.1081C: draw_text_outline 1 RGBA 0 0 0 2550340: set_text_draw_RGBA 255 255 255 2550226: [email protected] = actor $PLAYER_ACTOR armour045A: draw_text_1number 154.0 335.0 GXT 'NUMBER' number [email protected] // 'NUMBER' GXT Entry is "~1~". So in GXT Text '~1~' means NUMBERreturn Edited February 5, 2012 by casshem Link to comment Share on other sites More sharing options...
DK22Pac Posted February 5, 2012 Share Posted February 5, 2012 {$CLEO}0000:while true wait 0 if player.Defined(0) then 0226: [email protected] = actor $3 health 0226: [email protected] = actor $3 armour 03F0: enable_text_draw 1 0342: enable_text_draw_centered 1 033F: set_text_draw_letter_size 0.4 1.1 081C: draw_text_outline 1 RGBA 0 0 0 255 0340: set_text_draw_RGBA 255 255 255 255 045A: draw_text_1number 35.0 335.0 GXT 'NUMBER' number [email protected] 045A: draw_text_1number 154.0 335.0 GXT 'NUMBER' number [email protected] endend Link to comment Share on other sites More sharing options...
Silent Posted February 6, 2012 Share Posted February 6, 2012 @DK22Pac Unlike EXE draws, SCM ones reset the data after the draw, so you should make it like that instead: {$CLEO}0000: DRAWS while true wait 0 if player.Defined(0) then 0226: [email protected] = actor $3 health 0226: [email protected] = actor $3 armour 03F0: enable_text_draw 1 0342: enable_text_draw_centered 1 033F: set_text_draw_letter_size 0.4 1.1 081C: draw_text_outline 1 RGBA 0 0 0 255 0340: set_text_draw_RGBA 255 255 255 255 045A: draw_text_1number 35.0 335.0 GXT 'NUMBER' number [email protected] 0342: enable_text_draw_centered 1 033F: set_text_draw_letter_size 0.4 1.1 081C: draw_text_outline 1 RGBA 0 0 0 255 0340: set_text_draw_RGBA 255 255 255 255 045A: draw_text_1number 154.0 335.0 GXT 'NUMBER' number [email protected] endend Also, nice idea to not use $PLAYER_ACTOR, but it won't help much if SCM has actor handle on different var. Link to comment Share on other sites More sharing options...
DK22Pac Posted February 6, 2012 Share Posted February 6, 2012 @Silent You mean that .exe can change that values when it draws some from TextSprites elements? But there no "wait"s between these two "scm" drawers. And $PLAYER_ACTOR means it will always compile it as $3, until you change it in settings files. Link to comment Share on other sites More sharing options...
Silent Posted February 6, 2012 Share Posted February 6, 2012 If I remember well, SCM text drawers reset its style after they're drawed. Link to comment Share on other sites More sharing options...
casshem Posted February 9, 2012 Author Share Posted February 9, 2012 (edited) Thank you guys SOOOOO much! The mod is really coming along fellas, but I need help with this bit: 045A: draw_text_1number 35.0 335.0 GXT 'NUMBER' number [email protected] // ~1~ How do I draw a dollar sign before [email protected] get drawn so it becomes $~1~??? Edited February 9, 2012 by casshem Link to comment Share on other sites More sharing options...
Deji Posted February 9, 2012 Share Posted February 9, 2012 Use DOLLAR instead of NUMBER. DOLLAR is $~1~ in the GXT, so it's only obvious. Link to comment Share on other sites More sharing options...
casshem Posted February 9, 2012 Author Share Posted February 9, 2012 (edited) Two questions now: 1. How would I call up the zone text? I'm a bit confused by: 0154: actor $PLAYER_ACTOR in_zone 'EASB' // Easter Basin 2. How would I make it so that all the text disappears or is toggled off when you press f10? Here's what I have so far : Edited February 9, 2012 by casshem Link to comment Share on other sites More sharing options...
Recommended Posts