#1 06-03-2017 03:47

xAzKingx
Registered: 02-03-2017
Posts: 3

Help with this please.

{$CLEO}

{
    Mod Name:   Town\Zone texts
    Author:     Wesser
    Credits:    Nope
}

const
   PX                = 1@ 
   PY                = 2@ 
   PZ                = 3@ 
   CURRENT_TOWN      = 7@ 
   WIDESCREEN_STATUS = 8@ 
   IS_IN_WIDESCREEN  = 9@ 
   ENTER_STATUS      = 10@ 
   IS_OPENING_DOOR   = 11@ 
   IS_IN_CUTSCENE    = 12@ 
   RADAR_MODE        = 13@ 
   RADAR_ENABLED     = 14@ 
   IS_RADAR_ONSCREEN = 15@ 
   INTO_INTERIOR     = 16@ 
   IS_IN_INTERIOR    = 17@ 
///--------------------------
   ZONE_TEXT         = s$93 
   TOWN_TEXT         = s$95 
   INTERIOR_TEXT     = v$99 
end

IS_IN_WIDESCREEN = FALSE 
IS_OPENING_DOOR = FALSE 
IS_IN_CUTSCENE = FALSE 
IS_RADAR_ONSCREEN = TRUE 
IS_IN_INTERIOR = FALSE 

0000: Starting code...

while true
    wait 0 
    gosub @WideScreenCheck 
    gosub @OpenDoorCheck 
    gosub @CutsceneCheck 
    gosub @GetRadarOnScreen 
    
    if  or
        IS_IN_WIDESCREEN == TRUE 
        IS_OPENING_DOOR == TRUE 
        IS_IN_CUTSCENE == TRUE 
        IS_RADAR_ONSCREEN == FALSE 
    then
        03F0: enable_text_draw 0 
    else
        if  and
            80DF:   not actor $PLAYER_ACTOR driving
            00E1:   player $PLAYER_CHAR pressed_key 4 
        then
            03F0: enable_text_draw 0 
        else
            03F0: enable_text_draw 1 
            gosub @ZoneTextDisplay 
            
        end
    end
end

:WideScreenCheck
0A8D: WIDESCREEN_STATUS = read_memory 0xB6F065 size 4 virtual_protect 0 
if 
    WIDESCREEN_STATUS == 1 
then
    IS_IN_WIDESCREEN = TRUE 
else
    IS_IN_WIDESCREEN = FALSE 
end
return 

:OpenDoorCheck
0A8D: ENTER_STATUS = read_memory 0x96A7CC size 4 virtual_protect 0 // I found this :)
if  or
    ENTER_STATUS == 1 
    ENTER_STATUS == 2 
then
    IS_OPENING_DOOR = TRUE 
else
    IS_OPENING_DOOR = FALSE 
end
return 

:CutsceneCheck
if 
    06B9:   cutscene_data_loaded 
then
    if 
        82E9:   not cutscene_reached_end
    then
        IS_IN_CUTSCENE = TRUE 
    end
else
    IS_IN_CUTSCENE = FALSE 
end
return 

:GetRadarOnScreen
0A8D: RADAR_MODE = read_memory 0xBA676C size 4 virtual_protect 0 
0A8D: RADAR_ENABLED = read_memory 0xBAA3FB size 4 virtual_protect 0 
if  and
    RADAR_MODE == 2 
    RADAR_ENABLED == 0 
then
    IS_RADAR_ONSCREEN = FALSE 
else
    IS_RADAR_ONSCREEN = TRUE 
end
return 

:ZoneTextDisplay
gosub @InteriorCheck 

if 
    IS_IN_INTERIOR == FALSE
then
    gosub @GetZoneText 
    gosub @TownTextDisplay 
    
    if  or
        05AD:   ZONE_TEXT == 'LA'  // Los Santos
        05AD:   ZONE_TEXT == 'SF'  // San Fierro
        05AD:   ZONE_TEXT == 'VE'  // Las Venturas
    then
        05A9: ZONE_TEXT = 'CT'  // Country
    end
    if 
        05AD:   ZONE_TEXT == 'SAN_AND'  // San Andreas
    then
        05A9: ZONE_TEXT = 'CN'  // Ocean
    end
    gosub @DrawZoneText 
    
else
    gosub @InteriorTextDisplay 
    
end
return 

:InteriorCheck
077E: get_active_interior_to INTO_INTERIOR 
if 
    INTO_INTERIOR == 0 
then
    IS_IN_INTERIOR = FALSE
else
    IS_IN_INTERIOR = TRUE
end
return 

:GetZoneText
00A0: store_actor $PLAYER_ACTOR position_to PX PY PZ 
0843: get_zone_at PX PY PZ nameA_to ZONE_TEXT // 8-byte string 
return 

:TownTextDisplay
gosub @GetCurrentTown 

if 
    CURRENT_TOWN == 0 
then
    05A9: TOWN_TEXT = 'CS'  // Country Side
end
if 
    CURRENT_TOWN == 1 
then
    05A9: TOWN_TEXT = 'LA'  // Los Santos
end
if 
    CURRENT_TOWN == 2 
then
    05A9: TOWN_TEXT = 'SF'  // San Fierro
end
if 
    CURRENT_TOWN == 3 
then
    05A9: TOWN_TEXT = 'VE'  // Las Venturas
end
if 
    05AD:   ZONE_TEXT == 'SAN_AND'  // San Andreas
then
    05A9: TOWN_TEXT = 'SAN_AND'  // San Andreas
end
if 
    05AD:   ZONE_TEXT == 'LA'  // Los Santos
then
    05A9: TOWN_TEXT = 'LA'  // Los Santos
end
if 
    05AD:   ZONE_TEXT == 'SF'  // San Fierro
then
    05A9: TOWN_TEXT = 'SF'  // San Fierro
end
if 
    05AD:   ZONE_TEXT == 'VE'  // Las Venturas
then
    05A9: TOWN_TEXT = 'VE'  // Las Venturas
end
gosub @DrawTownText 

return 

:DrawZoneText
03E0: unknown_text_draw_flag 1 
033F: set_text_draw_letter_size 0.3 1.2 
0342: enable_text_draw_centered 1 
081C: draw_text_outline 2 RGBA 0 0 0 255 
033E: set_draw_text_position 88.0 426.0 GXT ZONE_TEXT 
return 

:GetCurrentTown
0842: CURRENT_TOWN = player $PLAYER_CHAR town_number
return 

:DrawTownText
03E0: unknown_text_draw_flag 1 
033F: set_text_draw_letter_size 0.3 1.2 
0342: enable_text_draw_centered 1 
081C: draw_text_outline 2 RGBA 0 0 0 255 
033E: set_draw_text_position 88.0 326.0 GXT TOWN_TEXT 
return 

:InteriorTextDisplay
gosub @GetInteriorText 
gosub @DrawInteriorText // DrawZoneText as DrawInteriorText
gosub @DrawTownText 

return 

:GetInteriorText
094B: INTERIOR_TEXT = get_active_interior_name_from_actor $PLAYER_ACTOR // 16-byte string
return 

:DrawInteriorText
03E0: unknown_text_draw_flag 1 
033F: set_text_draw_letter_size 0.3 1.2 
0342: enable_text_draw_centered 1 
081C: draw_text_outline 2 RGBA 0 0 0 255 
033E: set_draw_text_position 88.0 426.0 GXT INTERIOR_TEXT 
return 

I'm trying to use this script for this.

:GetMats
wait 0
if
Player.Defined($PLAYER_CHAR)
else_jump @GetZoneText
if and
0AB0:   key_pressed 110 
0AB0:   key_pressed 69     
else_jump @GetZoneText
018C: play_sound 1058 at 0.0 0.0 0.0
0AF9: samp say_msg "My location is '%s','%s'" 3407616 TOWN_TEXT ZONE_TEXT
wait 100
jump @GetMats

Why this is not working?

Offline

Board footer

Powered by FluxBB