CLEO Help Opcode

CLEO related
Status
Not open for further replies.

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
17
Location
Romania
Sanny Builder has an opcode that  recorded what I write?
Ex, I Write in Chat /69 so script will say "cmd 69".
I tried do something with FOR function but without succes :).

That is:

Code:
[quote]
{$CLEO .cs}

0000: NOP

:Noname_03
wait 0


:Noname_04
wait 0
IF 0256:   player $PLAYER_CHAR defined
JF @Noname_05
FOR 3@ = 0 to 999
SAMP.IsCommandTyped(3@)
IF 0AD4: 1@ = scan_string 3@ format "%d" 2@ //IF and SET
JF @Noname_05
say "/find %d" 3@

:Noname_05
jump @Noname_04
[/quote]
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
17
Location
Romania
It Crash my game :)  I tried to use just 0b77 => crash

Code:
{$CLEO .cs}

0000: NOP 
 
:Noname_2
0001: wait 0 ms 
 
:Noname_6
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @Noname_492 
0001: wait 0 ms

0B77: samp get_chat_input_text_to 1@
FOR 4@ = 0 to 999
IF 003B: 1@ == 4@  // (int)
THEN SAY " /find %d" 4@ // OR 1@
END


:Noname_485
0002: jump @Noname_6 
 
:Noname_492
0002: jump @Noname_2 

   
   
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
272
1@ would be a string, allocate memory for it, and you can't compare it like that, use either 0AD4, strcmp, strstr etc. or atoi to convert the string to an integer which you can compare like that.
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
17
Location
Romania
Tot primesc crash si nu stiu de ce, am alocat memoria dupa am scos-o si am lasat scriptul sa se repete pana la sfarsit.

Ceea ce e ciudat, primesc crash si la opcode-ul asta, inainte nu primeam crash,

Code:
{$CLEO .CS}

0000: NOP

:Noname_03
wait 0
IF
SAMP.Available()
JF @Noname_03

0B34: samp register_client_command "CMD" to_label @CMD


:Noname_04
wait 0
JUMP @Noname_04

:CMD
wait 0
FOR 0@ = 0 TO 999
IF 
SAMP.IsPlayerConnected(0@)
JF @C
12@ = SAMP.GetActorHandleByPlayerID(0@)
00A0: store_actor 12@ position_to 4@ 5@ 6@
SAMP.CmdRet

:C
chatmsg "%d not connected" 0@ -1
SAMP.CmdRet()

la 00A0: store_actor 12@ position_to 4@ 5@ 6@ , daca-l sterg nu primesc crash dar daca-l pun primesc ... pana la urma ce dracu are ca nu inteleg.
 

0x_

Wtf I'm not new....
Staff member
Administrator
Joined
Feb 18, 2013
Messages
1,123
Reaction score
174
And people who would have the same question could not understand a single fuck w/o google translate.
 
Status
Not open for further replies.
Top