CLEO Help Radar Visible

CLEO related
Status
Not open for further replies.

ItsRobinson

Active member
Joined
Nov 16, 2017
Messages
105
Reaction score
20
So I've been trying to work this out for so long, so SAMP servers that have a spectate feature most likely use this SAMP function
http://wiki.sa-mp.com/wiki/TogglePlayerSpectating

Which makes the map disappear, it just leaves the map ring but the actual map is invisible.

However, with s0beit, it doesn't do this, s0beit keeps the map visible. 

I've been trying to make it show using a CLEO but I just can't find how to do it.

I've tried:

Code:
{$CLEO .cs}

0000: NOP

:start
8AFA:   not is_samp_available 
004D: jump_if_false @cmd
0001: wait 400 ms 
0002: jump @start

:cmd
0B34: "radar" @on

:waithere
wait 0
jump @waithere

:on
wait 0
0A8C: write_memory 0xBA676C size 1 value 0 virtual_protect 0
0A8C: write_memory 0xBA6769 size 1 value 1 virtual_protect 0
0A8C: write_memory 0xA444A4 size 1 value FALSE virtual_protect 0
SAMP.CmdRet()
jump @waithere

Which didn't work, I also tried this, however I used the actual opcodes

08AC:
09AC:
057E:
0581:

Non of these have worked either. 

Anyone got any suggestions?
 

_=Gigant=_

Well-known member
Joined
Mar 21, 2017
Messages
353
Reaction score
16
0A8C: write_memory 12216172 size 1 value 2 virtual_protect 0   // map

0A8C: write_memory 12216169 size 1 value 2 virtual_protect 0   //  hud


Code:
{$CLEO .cs}
0000:
 
repeat
wait 0
until samp.Available()

/*chatmsg ""
chatmsg ""
chatmsg ""
chatmsg "" */
chatmsg "HUD&Radar Mod Loaded. To Open Menu Type /.hmenu"
//chatmsg "Press lctrl + 1~W~to enable hud~R~if disabled"
0B34: samp register_client_command ".aon" to_label @AllOn
0B34: samp register_client_command ".aof" to_label @AllOff
//////////////////////////////////////////////////////////
0B34: samp register_client_command ".rd1" to_label @RadarOn
0B34: samp register_client_command ".rd0" to_label @RadarOff
////////////////////////////////////////////////////////////
0B34: samp register_client_command ".hd1" to_label @HudOn
0B34: samp register_client_command ".hd0" to_label @HudOff
0B34: samp register_client_command ".hmenu" to_label @toggle
 
WHILE TRUE
WAIT 0     
 
IF
24@ == TRUE
THEN  
0AC6: 25@ = label @SHOW_DIALOG offset  
0B3B: samp show_dialog id 998 caption "Hud&Radar Mod" text 25@ button_1 "OK" button_2 "CLOSE" style 2  
   24@ = FALSE
END
 
IF 
0B3C: samp is_dialog_responded id 998 button 26@ list_item 27@ input_text 0
THEN
  
IF 
26@ == 1 // OK button
THEN
IF 
27@ == 2
THEN 
0826: display_hud 1
END
END

IF 
26@ == 1 // OK button
THEN
IF 
27@ == 3
THEN 
0826: display_hud 0
END
END      

IF 
26@ == 1 // OK button
THEN
IF 
27@ == 4
THEN 
0A8C: write_memory 12216172 size 1 value 0 virtual_protect 0
END      
END
 
IF 
26@ == 1 // OK button
THEN
IF 
27@ == 5
THEN 
0A8C: write_memory 12216172 size 1 value 2 virtual_protect 0
END      
END

IF 
26@ == 1 // OK button
THEN
IF 
27@ == 6
THEN 
0826: display_hud 1
0A8C: write_memory 12216172 size 1 value 0 virtual_protect 0
END      
END

IF 
26@ == 1 // OK button
THEN
IF 
27@ == 7
THEN 
0826: display_hud 0
0A8C: write_memory 12216172 size 1 value 2 virtual_protect 0
END      
END   
END
END

:SHOW_DIALOG
hex
//////////////////////////////////////////////////////////////////////////////////////////
"{148730}------------------Hud&Radar Mod Menu------------------" 0A
" " 0A
"{FFFFFF}Enable Hud" 0A
"{00FF00}Disable Hud" 0A 
"{FFFFFF}Enable Radar" 0A
"{00FF00}Disable Radar" 0A 
"{FFFFFF}Enable All" 0A
"{00FF00}Disable All" 0A 
//////////////////////////////////////////////////////////////////////////////////////////
"{148730}------------------------Commands----------------------" 0A
"{00FF00}Menu Open -> /.hmenu" 0A 
"{148730}------------------------------------------------------" 0A
"{FFFFFF}Disable Hud -> {00FF00}/.hd0" 0A 
"{FFFFFF}Enable Hud -> {00FF00}/.hd1" 0A
"{FFFFFF}Enable Radar -> {00FF00}/.rd1" 0A 
"{FFFFFF}Disable Radar -> {00FF00}/.rd0" 0A 
"{FFFFFF}Enable All-> {00FF00}/.aon" 0A 
"{FFFFFF}Disable All -> {00FF00}/.aof" 0A 
//////////////////////////////////////////////////////////////////////////////////////////
" " 00
end 

:HudViaKeyOnOff
wait 0
if and
0AB0: key_pressed 17    //left crtl
0AB0: key_pressed 49    // 1 number key
then
//jf @HudViaKeyOnOff
0826: display_hud 1
0A8C: write_memory 12216172 size 1 value 0 virtual_protect 0
0ACD: "~W~Hud&Radar Enabled" 500 
wait 50
end
if and
0AB0: key_pressed 17 
0AB0: key_pressed 48
then
0826: display_hud 0
0A8C: write_memory 12216172 size 1 value 2 virtual_protect 0
0ACD: "~W~Hud&Radar Disabled" 500 
wait 50
end
if and
0AB0: key_pressed 17 
0AB0: key_pressed 82
then
wait 100
0A8C: write_memory 12216172 size 1 value 2 virtual_protect 0
0ACD: "~W~Radar Disabled" 500 
end
if and
0AB0: key_pressed 17 
0AB0: key_pressed 82
then
wait 100
0A8C: write_memory 12216172 size 1 value 0 virtual_protect 0
0ACD: "~W~Radar Enabled" 500 
end
if and
0AB0: key_pressed 17 
0AB0: key_pressed 72
then
wait 100
0826: display_hud 1
0ACD: "~W~Hud Enabled" 500 
end
if and
0AB0: key_pressed 17 
0AB0: key_pressed 72
then
wait 100
0826: display_hud 0
0ACD: "~W~Hud Disabled" 500 
end
jump @HudViaKeyOnOff

:AllOn
wait 0
0826: display_hud 1
0A8C: write_memory 12216172 size 1 value 0 virtual_protect 0
0ACD: "~W~Hud&Radar Enabled" 500 
cmdret

:AllOff
wait 0
0826: display_hud 0
0A8C: write_memory 12216172 size 1 value 2 virtual_protect 0
0ACD: "~W~Hud&Radar Disabled" 500 
cmdret

:RadarOff
wait 0
0A8C: write_memory 12216172 size 1 value 2 virtual_protect 0
0ACD: "~W~Radar Disabled" 500 
cmdret

:RadarOn
wait 0
0A8C: write_memory 12216172 size 1 value 0 virtual_protect 0
0ACD: "~W~Radar Enabled" 500 
cmdret

:HudOff
wait 0
0826: display_hud 0
0ACD: "~W~Hud Disabled" 500 
cmdret

:HudOn
wait 0
0826: display_hud 1
0ACD: "~W~Hud Enabled" 500 
cmdret

:toggle
0B12: 24@ = 24@ XOR 1
cmdret

maybe this help

/.hmenu [attachment=5322]
 

Attachments

  • HudMod.cs
    23.6 KB · Views: 41

ItsRobinson

Active member
Joined
Nov 16, 2017
Messages
105
Reaction score
20
How am I supposed to get this into a CLEO though are these addresses not for the mod_sa?

@supahdupahnubah
@springfield
 
Joined
Feb 18, 2005
Messages
2,963
Reaction score
267
[shcode=cpp]
{$CLEO}
0000:

while true
   wait 0
   if 0AA2: 0@ = loadLib "samp.dll"
   then
       000A: 0@ += 0x9D318
       0A8C: writeMem 0@ sz 2 val 0x9090 vp 1
       0A93: end_custom_thread
   end
end
[/shcode]

or if you use SAMPFUNCS

[shcode=cpp]
0B2D: write_samp_memory offset 0x9D318 value 0x9090 size 2
[/shcode]

If you want to toggle it, just read 2 bytes to a variable before noping, then on deactivation, write the original data.
 
Status
Not open for further replies.
Top