CLEO Help hourglass

CLEO related
Status
Not open for further replies.

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
17
Location
Romania
im trying to render something and i find a problem if anyone is afk that rendered image[ex afk's id / name / hp etc ] will move as it wants , how to check if anyone is away from key board or he have the hourglass on?
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
https://github.com/BlastHackNet/mod_s0beit_sa/blob/master/src/samp.h#L647
or
0B5C: samp is_player 0@ paused // where 0@ is ID of a player
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
17
Location
Romania
i will try 0b5c after i end my job and i hope it works :d

another question, after i use 29@ = samp.getplayercolor(2@), how can i stock color in 0adc format ?

[shcode=cpp]0AD3: 9@ = format "{F6F7ED}ID: %d | {E20606}Health: %d | {B1C405}Distance: %0.1fm" 2@ 15@ 17@[/shcode]

"ID:%d" i want to have the same color as the player have


:-j there is what i tried to do

[shcode=cpp]{$CLEO}

:Noname_02
wait 0 ms

0B34: create command "on" to label @label

0@ = Render.CreateFont("Tahoma", 8, 0x5)
1@ = 0

while true
wait 0 ms
if 1@ == 1
then
for 2@ = 0 to 999
if SAMP.IsPlayerConnected(2@)
then
3@ = SAMP.GetActorHandleByPlayerID(2@)
if 056D: actor 3@ defined
then
04C4: store_coords_to 4@ 5@ 6@ from_actor 3@ with_offset 0.0 0.0 0.0
04C4: store_coords_to 10@ 11@ 12@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
0B55: convert_3D_coords 4@ 5@ 6@ to_screen 7@ 8@
0B25: 15@ = Get 2@ Health
alloc 9@ = 280
20@ = SAMP.GetPlayerColor(2@)
0AD3: 9@ = format "{F6F7ED}ID: %d | {E20606}Health: %d | {B1C405}Distance: %0.1fm" 2@ 15@ 17@
050A: 17@ = distance_between_XYZ 4@ 5@ 6@ and_XYZ 10@ 11@ 12@
if and
17@ < 200.0
17@ > 50.0
8B5C: samp is_player 2@ paused
then
Render.DrawText(0@, 9@, 7@, 8@, 0xFFffffff)
free 9@
end
end
end
end
end
end




:label
SAMP.IsCommandTyped(1@)
if 0ad4: 12@ 1@ "%d" 13@
then
if 13@ == 1
then 1@ = 1
else
if 13@ == 0
then 1@ = 0
end
end
end
SAMP.CmdRet [/shcode]

the problem is that when im looking in my face and i see id 835(ex) and after i look back, i can see the rendered image again :-s

http://imgur.com/a/BWQhB
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
Well the only way I can imagine to realise that is :
Code:
0@ = SAMP.GetPlayerColor(5@)
0B66: render argb 0@ to_a 1@ r 2@ g 3@ b 4@ 
alloc 9@ 256
format 9@ "{%X%X%X}test" 2@ 3@ 4@
free 9@

There might be easier methods as well
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
doroftel said:
cool, and the big problem? check the picture

Got no real idea on how to work with SF render opcodes overall, think it caused by not destroying text if player were visible previously but not on this comparison
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
17
Location
Romania
solved

[shcode=cpp] if and
17@ < 200.0 // max dist
17@ > 50.0 // min dist
02CB: actor 3@ bounding_sphere_visible[/shcode]


supahdupahnubah said:
There might be easier methods as well

[shcode=cpp]25@ = SAMP.GetPlayerColor(2@)
0AD3: 9@ = format "{%X}%s[%d]| {E20606}Health: %d | {B1C405}Distance: %0.1fm" 25@ 23@ 2@ 15@ 17@[/shcode]
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
17
Location
Romania
do anyone know from where this crash come from? this wh works perfectly 10 / 20 min ~ and after it crashes my game and i fck dont know, it is over my knowledge

there is a screen http://imgur.com/a/fRC9U

there is source[not messy :)) ]

[shcode=cpp]{$CLEO}

:Noname_02
wait 0 ms

0B34: create command "on" to label @label

0@ = Render.CreateFont("Comic Sans MS", 9, 0x5)
18@ = Render.CreateFont("Comic Sans MS", 9, 0x5)
19@ = Render.CreateFont("Comic Sans MS", 9, 0x5)

1@ = 0


while true
wait 0 ms
if 1@ == 1
 then
 
 for 2@ = 0 to 999
 if SAMP.IsPlayerConnected(2@)
   then
   3@ = SAMP.GetActorHandleByPlayerID(2@)
   if 056D:   actor 3@ defined
     then
     
        04C4: store_coords_to 4@ 5@ 6@ from_actor 3@ with_offset 0.0 0.0 0.0
        04C4: store_coords_to 10@ 11@ 12@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
       
        0B55: convert_3D_coords 4@ 5@ 6@ to_screen 7@ 8@
       
        0B25: 15@ = Get 2@ Health
       
        alloc 9@ = 280
        alloc 14@ = 280
        alloc 20@ = 280
       
        050A: 17@ = distance_between_XYZ 4@ 5@ 6@ and_XYZ 10@ 11@ 12@
       
        23@ = SAMP.GetPlayerNickname(2@)
        25@ = SAMP.GetPlayerColor(2@)
        0B26: samp 16@ = get_player_armor 2@

       
        0B66: render argb 25@ to_a 26@ r 27@ g 28@ b 29@
       
        0AD3: 14@ = format "{E20606}Health: %d" 15@
        0AD3: 9@ = format "%s[%d] | {B1C405}Distance: %0.1fm" 23@ 2@ 17@
        0AD3: 20@ = format "Armour: %d" 16@
       
       
        if and
          17@ < 200.0
          17@ > 57.0
          02CB:   actor 3@ bounding_sphere_visible
        then
        7@ -= 75
        8@ -= 25      
        Render.DrawText(0@, 9@, 7@, 8@,0xFFffffff)
   
       
        if 16@ > 1
        then
            7@ += 100
            8@ += 12
            Render.DrawText(19@,20@,7@,8@,0xFFffffff)  // Armour
            04C4: store_coords_to 4@ 5@ 6@ from_actor 3@ with_offset 0.0 0.0 0.0
            0B55: convert_3D_coords 4@ 5@ 6@ to_screen 7@ 8@
            7@ -= 50
            8@ -= 13
            Render.DrawText(18@,14@,7@,8@,0xFFffffff) // Health
        else
        04C4: store_coords_to 4@ 5@ 6@ from_actor 3@ with_offset 0.0 0.0 0.0
        0B55: convert_3D_coords 4@ 5@ 6@ to_screen 7@ 8@
        7@ -= 60
        8@ -= 13
        Render.DrawText(18@,14@,7@,8@,0xFFffffff) // Health
       
       
        free 9@
        free 14@
        free 20@
       
        end
        end
     end
     end
  end
  end
end

   
   
 
:label
SAMP.IsCommandTyped(1@)
if 0ad4: 12@ 1@ "%d" 13@
then
if 13@ == 1
then 1@ = 1
else
if 13@ == 0
then 1@ = 0
end
end
end
SAMP.CmdRet  
[/shcode]
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
17
Location
Romania
is there any opcode like : "player name tag is visible true/false" ? 
i want to disable the rendered image(wh) if distance between me and x is under 57m just if i see his name(if he's hidding over a wall/car etc i wont see it anymore u know)

is there any way to hide original name tags?
 
Status
Not open for further replies.
Top