Help check if there is any object within 15 meters, if any, it will be marked on the map through an icon, but after being activated my game crashes

luabrandao028

New member
Joined
Sep 4, 2023
Messages
1
Reaction score
0
{$CLEO .csi}

thread 'Marc'

:Marc
wait 0
00A0: store_actor $PLAYER_ACTOR position_to $14 $15 $16
04E6: object 0@ near_point 14@ 15@ 16@ radius 15.0 15.0 15.0 flag 0
0984: 10@ = object 0@ model

if
10@ == 1276
then
01BB: store_object 0@ position_to $72 $73 $74
04CE: 9@ = create_icon_marker 56 at $72 $73 $74
end

jump @Marc
 

Fr0z3n

Well-known member
Joined
Nov 20, 2019
Messages
300
Reaction score
36
Location
Srbija
{$CLEO .csi}
thread 'Marc'

// Initialize variables
0@ = 0 // Object ID
9@ = 0 // Marker ID
10@ = 0 // Object Model ID
14@ = 0.0 // Player X
15@ = 0.0 // Player Y
16@ = 0.0 // Player Z
marker_created = 0 // Flag to check if marker is already created

:Marc
wait 100 // Wait 100 milliseconds before next iteration
00A0: store_actor $PLAYER_ACTOR position_to $14 $15 $16
04E6: object 0@ near_point 14@ 15@ 16@ radius 15.0 15.0 15.0 flag 0

if
0@ > 0 // Check if an object actually exists
then
0984: 10@ = object 0@ model

if
10@ == 1276
then
if
marker_created == 0 // Check if marker is already created
then
01BB: store_object 0@ position_to $72 $73 $74
04CE: 9@ = create_icon_marker 56 at $72 $73 $74
marker_created = 1 // Set flag to indicate marker has been created
end
end
else
if
marker_created == 1 // Check if marker exists
then
0164: disable_marker 9@ // Remove marker
marker_created = 0 // Reset flag
end
end

jump @Marc
 
Top