CLEO Help press key

CLEO related
Status
Not open for further replies.

MalikeiraOPoder

Active member
Joined
Mar 16, 2019
Messages
100
Reaction score
2
when i press key "71" ( G )
this shit will open my dialog..
so.. i wanna do when i press G again, this key will close my Dialog..
and i cant do it zz

whats my mistake?

i did like that...

PHP:
IF
key_down 71
THEN
Dialog.SetVisible(0@, 1)
SAMP.ToggleCursor(1)
else
dialog.SetVisible(0@,0)
samp.togglecursor(0)
END

this code open my dialog and close my dialog automatic zz

@springfield @Opcode.eXe etc...
 

Kriso_Anderson

Active member
Joined
Apr 27, 2014
Messages
56
Reaction score
1
Try this
Code:
15@ = 0
IF and
key_down 71
15@ == 0
THEN
Dialog.SetVisible(0@, 1)
SAMP.ToggleCursor(1)
15@=1
end
if
15@==1
then
dialog.SetVisible(0@,0)
samp.togglecursor(0)
15@=0
end
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,699
Reaction score
106
Sorta depends on the rest of the code but yeah I'd do it like this.
Code:
IF
    key_down 71
THEN
    Dialog.SetVisible(0@, 1)
    SAMP.ToggleCursor(1)
    WAIT 25
    REPEAT
        WAIT 0
    UNTIL KEY_DOWN 71
    dialog.SetVisible(0@,0)
    samp.togglecursor(0)
END
 

MalikeiraOPoder

Active member
Joined
Mar 16, 2019
Messages
100
Reaction score
2
i did like that.. and now is working, thanks guys

PHP:
        IF
        key_down 71
        THEN
            IF 0B87: dialog 20@ is_visible
            THEN
                0@ = 0
            ELSE
                0@ = 1
            END   
            call @ToggleDialog 2 20@ 0@
            wait 200
        END


:ToggleDialog
0B86: 0@ 1@
0B5D: 1@
ret 0
 
Status
Not open for further replies.
Top