Timp rămas până la Black Week
Pentru detalii complete despre promoție click aici
Black Week a început!
Pentru detalii complete despre promoție click aici
Search the Community
Showing results for tags 'cleo'.
-
Hello, Would it be possible in CLEO to get the first or last 20 characters from a string, for example? I want to implement a function in a script that if I write something which has more than 99 characters, then the additional characters will be sent as a second message automatically. I have no idea where to start with this particular section of code, so there's nothing already made for now. I know the CLEO language enough to implement it in my script afterwards.
-
Hello, There is a CLEO script, made by TheTom, which places a checkpoint on your map and in the game, at coordinates that are being read from a .ini file. The original script has about 300 KB, because for every checkpoint, there is the same code being repeated in the script over and over again. What I am trying to do is to use the integer that I pass via a chat command, to dynamically change to which coordinate in the .ini file I want to load. This is the whole script: {$CLEO .cs} 0000: REPEAT WAIT 0 UNTIL 0AFA: is_samp_available chatmsg "{FF8C00}QuestHelper {ffffff}- /qhelp - {FF8C00}By TheTom" -1 0B34: samp register_client_command "qhelp" to_label @qhelp 0B34: samp register_client_command "last" to_label @last 0B34: samp register_client_command "ccp" to_label @ccp 0B34: samp register_client_command "scp" to_label @showcp :repeat wait 0 jump @repeat :qhelp chatmsg "{B399F1}/cp <numar> {ffffff} - seteaza checkpoint-ul cu numarul X" -1 chatmsg "{B399F1}/ccp{ffffff} - opreste afisarea pe harta checkpoint-ului curent" -1 chatmsg "{B399F1}/last{ffffff} - vezi care a fost ultimul checkpoint setat" -1 samp.CmdRet :last chatmsg "{B399F1}Ultimul checkpoint setat a fost {ffffff}%d" -1 18@ samp.CmdRet :showcp SAMP.IsCommandTyped(18@) 06D6: disable_racing_checkpoint 2@ 08FB: set_checkpoint 2@ type_to 0 08FB: set_checkpoint 3@ type_to 0 06D6: disable_racing_checkpoint 3@ 0AF0: 20@ = get_int_from_ini_file "CLEO\QuestHelper.ini" section "QuestHelper" key "x1" 0AF0: 21@ = get_int_from_ini_file "CLEO\QuestHelper.ini" section "QuestHelper" key "y1" 0AF0: 22@ = get_int_from_ini_file "CLEO\QuestHelper.ini" section "QuestHelper" key "z1" 06D5: 2@ = create_racing_checkpoint_at 20@ 21@ 22@ point_to 0 0 0 type 1 radius 3.0 08FB: set_checkpoint 2@ type_to 1 018A: 3@ = create_checkpoint_at 20@ 21@ 22@ 08FB: set_checkpoint 3@ type_to 1 25@ = 1 chatmsg "{B399F1}A fost setat checkpoint-ul %s" -1 18@ samp.CmdRet :ccp 06D6: disable_racing_checkpoint 2@ 08FB: set_checkpoint 2@ type_to 0 08FB: set_checkpoint 3@ type_to 0 06D6: disable_racing_checkpoint 3@ chatmsg "{B399F1}Checkpoint-ul a fost sters." -1 samp.CmdRet What I want to do, exactly, is using "18@" (which is the integer passed with the "/scp <integer>" command) with "x", "y", and "z", at the "section "QuestHelper" key "x1" part. This would make the same portion of the code reusable, instead of having the same code repeated 300 times (like in the original script). Is this possible to do somehow? The first instinct was to try: 0AF0: 20@ = get_int_from_ini_file "CLEO\QuestHelper.ini" section "QuestHelper" key "x%s" 18@ which of course, doesn't work. Having "%d" instead of "%s" doesn't work either, and normally you can't combine strings with integers anyways, so it must be taken as a string.
-
Salut, Revin cu o noua solicitare de ajutor Incerc sa fac un script prin care sa poti da texte pe /news sau pe /l (live) la News Reporters. Cu ce ajuta scriptul, este ca verifica numarul de caractere al textului introdus, iar daca se depaseste o anumita valoare, textul nu mai este trimis, evitand astfel trimiterea unui text care dupa aceea va aparea incomplet in chat, ori pe doua randuri. Acest lucru functioneaza, insa ma gandeam sa mai pun o functie, ce te ajuta sa setezi de dinainte randul 1 si randul 2 al unui mesaj ce va fi pe doua randuri, si sa ai posibilitatea de a vedea cum arata mesajele introduse inainte de a fi trimise, iar apoi dai o comanda si se trimit ambele. Ce nu functioneaza este comanda de a afisa mesajele deja introduse in script. Am pus un "chatmsg" si un "say" la fiecare introducere de mesaj prin "/nwone" sau "/lvone" ori prin "/nwtwo" sau "/lvtwo" (pentru confirmare ca functioneaza/debug), si mesajul apare, insa cand dau "/nwview" sau "/lvview", mesajul nu mai este afisat. Tot ce apare este "[]" (in mod normal este [%s], unde %s este mesajul 1 sau mesajul 2, introduse prin comenzile respective). Sper ca am exprimat destul de clar problema, iar daca este nevoie de detalii aditionale, va rog sa imi spuneti. Script: https://pastebin.com/zhYa1DJK
-
Salut din nou, Am o functie in script care citeste ora serverului, pe baza textului aparut cu data si ora in dreapta sus. Aceasta functie functioneaza ok. Folosesc aceasta functie ca sa vad care este ora serverului (fiindca ora locala poate fi schimbata cu un script, cu [/sett]), si in functie de ora sa spuna un anumit mesaj. Comanda este [/stime] (server time), si functioneaza prima oara cand o dau, insa apoi nu mai functioneaza pur si simplu. Desi nu stiu precis dupa cat timp, comanda mai functioneaza iar o data, si apoi iar nimic. Care ar putea fi cauza? https://pastebin.com/Msj7bkeF
-
Hi, I'm starting with CLEO and I have some question / problem. How to make timer with 5 min countdown on screen whenever This Text show in chat "Total payoff:" when you finish a job i made this code but it full with misstakes i hope someone turn my idea into reality {$CLEO} {$INCLUDE SF} 0000: repeat wait 0 until SAMP.Available() alloc 29@ 256 0BE3: raknet setup_incoming_rpc_hook @auto_chat while true wait 0 if and 8B21: samp is_chat_opened 8C7E: is_console_active then 0@ = FALSE 1@ = 300 // The lenght of the countdown by seconds 1@ *= 1000 // converting it to milliseconds if 0ADC: test_cheat "JOB" THEN if 2@ == 0 then 0ACD: show_text_highpriority "AutoJob ~g~ON" time 1000 018C: play_sound 1083 at 0.0 0.0 0.0 2@ = 1 wait 250 else 0ACD: show_text_highpriority "AutoJob ~r~OFF" time 1000 018C: play_sound 1084 at 0.0 0.0 0.0 2@ = 0 wait 250 end end END END :looperulee wait 0 jump @looperulee :auto_chat 0BE5: raknet 31@ = get_hook_param PARAM_PACKETID if 31@ == RPC_ScrClientMessage then 0C11: memset destination 29@ value 0 size 256 0BE5: raknet 31@ = get_hook_param PARAM_BITSTREAM 0BE7: raknet 30@ = bit_stream_read 31@ type BS_TYPE_INT //color 0BE7: raknet 30@ = bit_stream_read 31@ type BS_TYPE_INT //lenght 0BE8: raknet bit_stream 31@ read_array 29@ size 30@ //string 0C0D: struct 29@ offset 30@ size 1 = 0 end WHILE TRUE WAIT 0 if or 0C29: $NULL_STIRNG = stristr string1 29@ string2 "Total payoff:" 0C29: $NULL_STIRNG = stristr string1 29@ string2 "Total payoff: $%d" THEN if 2@ == 1 then 0@ = TRUE REPEAT WAIT 0 UNTIL 8AB0: key_pressed 113 32@ = 0 END IF 0@ == TRUE THEN 0085: 2@ = 1@ // (int) 0085: 3@ = 32@ // (int) 0062: 3@ -= 2@ // (int) 3@ /= 1000 3@ *= -1 0AD1: show_formatted_text_highpriority "TIME_LEFT: %d" time 1000 3@ END IF AND 0@ == TRUE 001D: 32@ > 1@ // (int) THEN 0@ = FALSE 0AD1: show_formatted_text_highpriority "! GO !" time 2000 0x0AD1 END END
-
Salut, Am un script de tip "TaxiCMD", care are diverse comenzi utile. Ce incerc sa fac este sa adaug o comanda "/fvr10", care anunta pe /f ca se va da /fvr, asteapta 10 secunde, si apoi da comanda /fvr. Problema este ca "wait" functioneaza doar in loops, si desi stiind asta, tot nu reusesc sa fac sa functioneze cum trebuie. Nu am mai codat CLEO initial, insa ma descurc in general, astfel ca am reusit sa adaug diverse chestii noi, intrucat erau similare cu alte chestii deja existente in script. Nu inteleg exact ce gresesc. De asemenea, as vrea si pentru /fvr5 sa imi spuna dupa 5 secunde pe chat ca au trecut 5 secunde si ca pot da /fvr, daca nu e ceva super greu (deja pare greu de adaugat un wait). https://pastebin.com/7UNnAdD8