CLEO Help Help with 0092

CLEO related
Status
Not open for further replies.

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
17
Location
Romania
Code:
Actor.StorePos(0@, 1@, 2@, 3@)
Actor.StorePos(PLAYER_ACTOR$, 4@, 5@, 6@)
050A: 7@ = distance_between_XYZ $TEMPVAR_1@ 2@ 3@ and_XYZ 4@ 5@ 6@
0092: 8@ = float 7@ to_integer
if
8@ <= 5.0
then
SCRIPT

not working, idk why, can anyone tell me why?
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
273
Hm, what's $TEMPVAR_?

Also, what exactly is not working?
Also, why do you convert to an integer and then compare to a float?
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
17
Location
Romania
you lost me :))
Code:
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP 

:Noname_2
0001: wait 0 ms 

:Noname_6
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @Noname_281 
0001: wait 0 ms 
00D6: if and
00DF:   actor $PLAYER_ACTOR driving 
0ADC:   test_cheat "~#~R$" 
004D: jump_if_false @Noname_47 

:Noname_47
00D6: if and
8B21:   not samp is_chat_opened 
0AB0:   key_pressed 67 
004D: jump_if_false @Noname_274 
0006: 0@ = -1 

:Noname_71
000A: 0@ += 1 
8039:   not  0@ == 1000 
004D: jump_if_false @Noname_272 
0B23:  samp is_player_connected 0@ 
004D: jump_if_false @Noname_71 
0B20: samp 1@ = actor_handle_by_samp_player_id 0@ 
00D6: if 
056D:   actor 1@ defined 
004D: jump_if_false @Noname_71 
00A0: store_actor $PLAYER_ACTOR position_to 10@ 11@ 12@ 
00A0: store_actor 1@ position_to 13@ 14@ 15@ 
050A: 16@ = distance_between_XYZ 10@ 11@ 12@ and_XYZ 13@ 14@ 15@ 
0093: 17@ = integer 16@ to_float 
00D6: if 
0021: 17@ <= 10.0 // am testat si cu .0 si fara.
004D: jump_if_false @Noname_272 
00D6: if 
00DF:   actor 1@ driving 
004D: jump_if_false @Noname_265 
0AF9: samp say_msg "/repair %d 1" 0@  
0AF9: samp say_msg "/refill %d 1" 0@  

:Noname_265
0002: jump @Noname_71 

:Noname_272
0B43: samp cmd_ret 

:Noname_274
0002: jump @Noname_6 

:Noname_281
0002: jump @Noname_2
Pe romaneste, daca X se afla langa mine la o distanta mai mica de 10 unitati atunci, daca apas C sa execute 0AF9, el insa nu tine cont de distanta ... si executa acel opcode pentru toti din Stream Zone :(.
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
273
Opcode 0021 is for "0021: 26@ > 64.0"

[shcode=cpp]
if and
16@ <= 10.0
00DF: actor 1@ driving
then
0AF9: samp say_msg "/repair %d 1" 0@
0AF9: samp say_msg "/refill %d 1" 0@
end
[/shcode]
 
Status
Not open for further replies.
Top