CLEO Help /next & /prev

CLEO related
Status
Not open for further replies.

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
Code:
{$CLEO}
{$INCLUDE SF}
0000:
thread "TesterCMD"

repeat
wait 0
until SAMP.Available()

15@ = 0

0B34: "start" @start
0B34: "stop" @stop
0B34: "next" @next
0B34: "prev" @previous

WHILE TRUE
WAIT 0
    
    IF 10@ == -1
    THEN
        chatmsg "{cecece}[TesterCMD]: {ff0000}Foloseste /next pentru a pune prima intrebare." -1
        10@ = 0
    END
    
    IF 10@ == 22
    THEN
        chatmsg "{cecece}[TesterCMD]: {ff0000}Testul a luat sfarsit (modul a fost resetat)." -1
        10@ = 0
    END

END

:start
0B2B: samp 1@ = get_player_id_by_actor_handle $PLAYER_ACTOR
0B36: samp 6@ = get_player_nickname 1@
say "/cw Salut, eu sunt testerul tau %s, cu mine o sa sustii testul de intrare in Paramedic Department." 6@
say "/cw Pentru inceput, tasteaza [/turn off] si [/setfreq 0]."
say "/cw Daca dai [/q] esti picat, dacpa iei crash ai timp 5 minute sa revii."
say "/cw O greseala 1/3 si 3/3 = picat, iar 3 secunde AFK = picat."
say "/cw Timp de raspuns 60 de secunde. Incepem?"
SAMP.CmdRet()

:stop
IF SAMP.IsCommandTyped(20@)
THEN
    IF 0AD4: $NOT_USED = scan_string 20@ format "trecut %d" 0@
    THEN
        0B36: samp 1@ = get_player_nickname 0@
        say "/cw Felicitari, %s! Ai trecut testul in Paramedic Las Venturas!" 1@
        15@ = 20
    ELSE
        IF 0AD4: $NOT_USED = scan_string 20@ format "picat %d" 0@
        THEN
            0B36: samp 1@ = get_player_nickname 0@
            say "/cw Imi pare rau, %s. Ai picat testul in Paramedic Las Venturas." 1@
            15@ = 20
        END
    END
ELSE
    chatmsg "{cecece}[TesterCMD]: {ff0000}Jucator trecut: /stop trecut <id>" -1
    chatmsg "{cecece}[TesterCMD]: {ff0000}Jucator picat: /stop picat <id>" -1
END
SAMP.CmdRet()

:next
10@ += 1
alloc 25@ 260
alloc 26@ 260
format 18@s "q%d" 10@
0AF4: 25@ = read_string_from_ini_file "cleo\TesterCMD.ini" section "Questions" key 18@s
0AF4: 26@ = read_string_from_ini_file "cleo\TesterCMD.ini" section "Answers" key 18@s
chatmsg 21@ -1
free 25@
free 26@
SAMP.CmdRet()

:previous
10@ -= 1
alloc 25@ 260
alloc 26@ 260
format 18@s "q%d" 10@
0AF4: 25@ = read_string_from_ini_file "cleo\TesterCMD.ini" section "Questions" key 18@s
0AF4: 26@ = read_string_from_ini_file "cleo\TesterCMD.ini" section "Answers" key 18@s
chatmsg 21@ -1
free 25@
free 26@
SAMP.CmdRet()

So i have the code above.. /next and /prev don't work, they instantly crash and /start doesn't work either.. it just.. doesn't say anything.. Can anyone please help me? i'm confused.
What is /next and /prev supposed to do? Once you type /prev or /next it will change the variable 10@ (int) to match the format of the key to take the strings from .ini however those don't work and i'm not sure why.. anyone can help?
 

Hidend

Expert
Joined
Mar 4, 2013
Messages
653
Reaction score
49
In :next and :.previous you use chatmsg 21@ when 21@ is not defined...
in :start I'm not really sure, you could try adding wait between the "say", just debug what happens
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,719
Solutions
1
Reaction score
111
Code:
[13:24:34] /cw Salut, eu sunt testerul tau Zin, cu mine o sa sustii testul de intrare in Paramedic Department.
[13:24:34] /cw Pentru inceput, tasteaza [/turn off] si [/setfreq 0].
[13:24:34] /cw Daca dai [/q] esti picat, dacpa iei crash ai timp 5 minute sa revii.
[13:24:34] /cw O greseala 1/3 si 3/3 = picat, iar 3 secunde AFK = picat.
[13:24:34] /cw Timp de raspuns 60 de secunde. Incepem?
/START does work as I made it log to console and that was the output. /next /prev didn't work probably because I didn't have the .ini but yeah 21@ chatmsg seems a bit out of place. Also try debugging the "ini file" input params before they're input as they may be incorrect.
 

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
@Zin why does it not work for me?? i use sampfuncs 5.4.1 and cleo 4.1.. it doesn't work and i'm not sure what's wrong.. It simply doesn't say anything then after 10-15 seconds it reconects me to the server..
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,719
Solutions
1
Reaction score
111
@Zin why does it not work for me?? i use sampfuncs 5.4.1 and cleo 4.1.. it doesn't work and i'm not sure what's wrong.. It simply doesn't say anything then after 10-15 seconds it reconects me to the server..
Could be a server thing, replace "SAY" with "LOG" or "CHATMSG" to see if it does actually output.
 
Status
Not open for further replies.
Top