CLEO Help Cleo help

CLEO related
Status
Not open for further replies.

Serioga

Member
Joined
Jan 31, 2017
Messages
7
Reaction score
0
Hello everybody.
I am beginner at cleo and i want to make a cleo that closes the game, quits from server automatically, then a dialog pops up.
I have been trying to create something for couple of hours, but nothing good, the game always crashes.
Any ideas?
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
What you got so far? Anyway I can't find it logical, how could you exit the game, then disconnect from the server and pop up a dialog? I mean the first step.. You already closed the game, guess there's nothing that can be done after this
 

Serioga

Member
Joined
Jan 31, 2017
Messages
7
Reaction score
0
supahdupahnubah said:
What you got so far? Anyway I can't find it logical, how could you exit the game, then disconnect from the server and pop up a dialog? I mean the first step.. You already closed the game, guess there's nothing that can be done after this

Sorry man, wrong sequence :D, i mean if some dialog would pop up cleo would close the game
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
Serioga said:
supahdupahnubah said:
What you got so far? Anyway I can't find it logical, how could you exit the game, then disconnect from the server and pop up a dialog? I mean the first step.. You already closed the game, guess there's nothing that can be done after this

Sorry man, wrong sequence :D, i mean if some dialog would pop up cleo would close the game

Don't know about the opcode to close the game, nor the game destructor address, noobish solution on how to close the game might be pretty simple : 0C8F: samp process_chat_input "/q"; Not that fast tho, but still capable to close the game quickly enough..
If you need to check if ANY dialog is active, use 0B4C: samp is_dialog_active -1; Still need to check if this is a certain dialog or whatever? Use 0B4E: samp 0@ = get_current_dialog_id or 0BD8: samp get_dialog_caption 0@, or even 0BD7: samp get_dialog_text 0@

Guess you Russian also so you pretty able to use blast.hk sampfunc opcode library for rest : http://blast.hk/wiki/opcodes:sampfuncs:list
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
273
[shcode=cpp]
0AA2: 0@ = "kernel32.dll"
0AA4: 1@ = "ExitProcess" library 0@
0AA5: 1@ nparams 1 pop 0 _ec 1
[/shcode]

Make it a func, and call it when you want to fast exit the game.
 

Serioga

Member
Joined
Jan 31, 2017
Messages
7
Reaction score
0
Okay guys thanks i made it
Code:
{$CLEO .cs}
0000:
while not samp.Available()
    wait 100
end
alloc 2@ 8
format 2@ "Title" //dialog title to detect
 
while true
wait 0
if
0B4C: samp is_dialog_active -1
then
    alloc 3@ 256                           
    0BD8: samp get_dialog_caption 3@ 
    if 0C14: strcmp string1 2@ string2 3@ //comparing 
    then
        free 3@
        wait 500
        0C8F: samp process_chat_input "/q"
        end
    end
end

But i somehow failed to make activation/diactivation of that, maybe someone can add it? because then i am trying to add it cleo crashes the game :(
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
Serioga said:
But i somehow failed to make activation/diactivation of that, maybe someone can add it? because then i am trying to add it cleo crashes the game :(

Look up for activation tutorials, also will be better if you put quit command before wait 500 so it will quit faster .-.

@springfield guess we should put some "ugbase.eu" lines on solution snippets, since some people will use them as a full script and more likely distribute somewhere :D
 
Status
Not open for further replies.
Top