Help me please, I need to fix this cmd!

Joined
Mar 20, 2020
Messages
21
Likes
0
Points
1
Location
Romania
1
#1
So I have this cmd:

{$CLEO}


0662: "InstructorCMD creat de MrPopeye pentru School Instructors Las Venturas(OG-Times)."
thread "InstructorCMD creat de MrPopeye pentru School Instructors Las Venturas(OG-Times)."
wait 2500
0B34: samp register_client_command "comenzi" to_label @cmd_1
0B34: samp register_client_command "gun" to_label @cmd_2
0B34: samp register_client_command "fly" to_label @cmd_3
0B34: samp register_client_command "boat" to_label @cmd_4
0B34: samp register_client_command "g1" to_label @cmd_5
0B34: samp register_client_command "g2" to_label @cmd_7
0B34: samp register_client_command "g3" to_label @cmd_8
0B34: samp register_client_command "g4" to_label @cmd_9
0B34: samp register_client_command "g5" to_label @cmd_10
0B34: samp register_client_command "g6" to_label @cmd_11
0B34: samp register_client_command "g7" to_label @cmd_12
0B34: samp register_client_command "g8" to_label @cmd_13
0B34: samp register_client_command "f1" to_label @cmd_14
0B34: samp register_client_command "f2" to_label @cmd_16
0B34: samp register_client_command "f3" to_label @cmd_17
0B34: samp register_client_command "f4" to_label @cmd_18
0B34: samp register_client_command "f5" to_label @cmd_19
0B34: samp register_client_command "b1" to_label @cmd_20
0B34: samp register_client_command "b2" to_label @cmd_22
0B34: samp register_client_command "b3" to_label @cmd_23
0B34: samp register_client_command "b4" to_label @cmd_24
0B34: samp register_client_command "b5" to_label @cmd_25
0B34: samp register_client_command "an" to_label @cmd_26
0B34: samp register_client_command "a1" to_label @cmd_27
0B34: samp register_client_command "guni" to_label @cmd_28
0B34: samp register_client_command "flyi" to_label @cmd_29
0B34: samp register_client_command "boati" to_label @cmd_30
0B34: samp register_client_command "toatei" to_label @cmd_31
0B34: samp register_client_command "gunf" to_label @cmd_33
0B34: samp register_client_command "flyf" to_label @cmd_34
0B34: samp register_client_command "boatf" to_label @cmd_35
0B34: samp register_client_command "toatef" to_label @cmd_36
0B34: samp register_client_command "feu" to_label @cmd_37
0B34: samp register_client_command "update" to_label @cmd_38





0AB1: call_scm_func @chatmsg 0


:cmd_39
wait 0
jump @cmd_39

:cmd_1
SAMP.IsCommandTyped([email protected])
chatmsg "{408080}----------------------------------------------------InstructorCMD----------------------------------------------------"
chatmsg "{FFFFFF}Pentru a vedea comenzile pentru licenta 'Gun', 'Fly' sau 'Boat', tasteaza: [/gun], [/fly] sau [/boat]."
chatmsg "{FFFFFF}Comanda [/an] pune direct modelul de [/ad], trebuie sa va aflati la CNN."
chatmsg "{FFFFFF}Comanda [/a1] scrie pe chatul normal modelul de 'ad' ca oferiti licente."
chatmsg "{FFFFFF}Comanda [/gunf <ID-ul jucatorului>] scrie pe [/f] textul urmator: X doreste licenta de arme, contactati-l."
chatmsg "{FFFFFF}Comanda [/flyf <ID-ul jucatorului>] scrie pe [/f] textul urmator: X doreste licenta de zbor, contactati-l."
chatmsg "{FFFFFF}Comanda [/boatf <ID-ul jucatorului>] scrie pe [/f] textul urmator: X doreste licenta de barci, contactati-l."
chatmsg "{FFFFFF}Comanda [/toatef <ID-ul jucatorului>] scrie pe [/f] textul urmator : X doreste toate licentele, contactati-l."
chatmsg "{FFFFFF}Comanda [/feu] scrie pe [/f] textul urmator: Ma ocup eu de client, multumesc!"
chatmsg "{FFFFFF}Comanda [/guni <ID-ul jucatorului>] scrie pe [/in] textul urmator: X doreste licenta de arme, contactati-l."
chatmsg "{FFFFFF}Comanda [/flyi <ID-ul jucatorului>] scrie pe [/in] textul urmator: X doreste licenta de zbor, contactati-l."
chatmsg "{FFFFFF}Comanda [/boati <ID-ul jucatorului>] scrie pe [/in] textul urmator: X doreste licenta de barci, contactati-l."
chatmsg "{FFFFFF}Comanda [/toatei <ID-ul jucatorului>] scrie pe [/in] textul urmator: X doreste toate licentele, contactati-l."
chatmsg "{FFFFFF}Comanda {FF0000}[/update] {FFFFFF}- afiseaza toate noutatile adaugate in InstructorCMD."
chatmsg "{408080}---------------------------------------------------------------------------------------------------------------------"
SAMP.CmdRet

:cmd_2
SAMP.IsCommandTyped([email protected])
chatmsg "{408080}Comenzile pentru licenta de arme(gun)."
chatmsg "{FFFFFF}[/g1] - Ma prezint."
chatmsg "{FFFFFF}[/g2] <ID-ul MEU> - Il rog sa-mi arate licentele folosind comanda [/sl]."
chatmsg "{FFFFFF}[/g3] - Informatii despre plata licentei"
chatmsg "{FFFFFF}[/g4] - Ii prezint informatiile."
chatmsg "{FFFFFF}[/g5] - Incepi testul teoretic / ii pui prima intrebare."
chatmsg "{FFFFFF}[/g6] - Se afiseaza a doua intrebare."
chatmsg "{FFFFFF}[/g7] - Se afiseara a treia intrebare."
chatmsg "{FFFFFF}[/g8] <ID-ul jucatorului> - Ii dai un SD-pistol pentru a trage gloantele in pamant."
chatmsg "{FFFFFF}[/g9] - Ii acorzi licenta de gun."
chatmsg "{408080}-----------------------------------------------------------------------------------------------------------"
SAMP.CmdRet

:cmd_3
SAMP.IsCommandTyped([email protected])
chatmsg "{408080}Comenzile pentru licenta de zbor(fly)."
chatmsg "{FFFFFF}[/f1] - Ma prezint."
chatmsg "{FFFFFF}[/f2] <ID-ul MEU> - îl rog sa-mi arate licentele folosind comanda [/sl]."
chatmsg "{FFFFFF}[/f3] - îl rog sa plateasca licenta"
chatmsg "{FFFFFF}[/f4] <ID-ul jucatorului> - îi dã [/startlesson] si îi spune sã decoleze."
chatmsg "{FFFFFF}[/f5] - Ii spune sã aterizeze pe o clãdire."
chatmsg "{FFFFFF}[/f6] <ID-ul jucatorului> - îi dau licenta si-l anunt cã este valabilã 100 de ore."
chatmsg "{408080}-----------------------------------------------------------------------------------------------------------"
SAMP.CmdRet

:cmd_4
SAMP.IsCommandTyped([email protected])
chatmsg "{408080}Comenzile pentru licenta de barci(boat)."
chatmsg "{FFFFFF}[/b1] - Ma prezint."
chatmsg "{FFFFFF}[/b2] <ID-ul MEU> - îl rog sa-mi arate licentele folosind comanda [/sl]."
chatmsg "{FFFFFF}[/b3] - îl rog sa plateasca licenta."
chatmsg "{FFFFFF}[/b4] <ID-ul jucatorului> - îi dã [/startlesson] si îi spune sã porneasca."
chatmsg "{FFFFFF}[/b5] - îi spune sã meargã putin în fatã si sã se întoarca."
chatmsg "{FFFFFF}[/b6] <ID-ul jucatorului> - îi dau licenta si-l anunt cã este valabila 100 de ore."
chatmsg "{408080}-----------------------------------------------------------------------------------------------------------"
SAMP.CmdRet


:cmd_5
SAMP.IsCommandTyped([email protected])
chatmsg "{408080}InstructorCMD: Licenta gun - 1/8."
0AF9: samp say_msg "Salut, sunt membrul factiunii School Instructors LV si te voi ajuta sa obtii licenta de 'Gun'."
0AF9: samp say_msg "Pentru inceput tasteaza comanda [/sl SkyLon] pentru a-ti verifica licentele."
SAMP.CmdRet

:cmd_7
SAMP.IsCommandTyped([email protected])
chatmsg "{408080}InstructorCMD: Licenta gun - 2/8."
0AF9: samp say_msg "Acum trebuie sa-mi platesti 2,000,000$, iar restul de 2,000,000$ la final."
SAMP.CmdRet

:cmd_8
SAMP.IsCommandTyped([email protected])
chatmsg "{408080}InstructorCMD: Licenta gun - 3/8."
0AF9: samp say_msg "Inainte de testul teoretic, o sa-ti spun cateva informatii:"
0AF9: samp say_msg "1. Poti face DM doar pe politisti(on-duty) sau la 'clan turf'."
0AF9: samp say_msg "2. Odata ce ai aceasta licenta, poti achizitiona arme din 'Gun Shop'."
SAMP.CmdRet

:cmd_9
SAMP.IsCommandTyped([email protected])
chatmsg "{408080}InstructorCMD: Licenta gun - 4/8."
0AF9: samp say_msg "Bun, sa trecem la testul teoretic:"
0AF9: samp say_msg "1. Ai voie sa faci DM pe un politist off-duty?"
SAMP.CmdRet

:cmd_10
SAMP.IsCommandTyped([email protected])
chatmsg "{408080}InstructorCMD: Licenta gun - 5/8"
0AF9: samp say_msg "2. Te rog sa-mi zici un tip de arma din 'Gun Shop'."
SAMP.CmdRet

:cmd_11
SAMP.IsCommandTyped([email protected])
chatmsg "{408080}InstructorCMD:Licenta gun - 6/8."
0AF9: samp say_msg "3. Poti face DM pe 'clan turf'?"
SAMP.CmdRet

:cmd_12
SAMP.IsCommandTyped([email protected])
if
0AD4: [email protected] = scan_string [email protected] format "%d" [email protected]
then
0B36: samp [email protected] = get_player_nickname [email protected]
chatmsg "{408080}InstructorCMD: Licenta gun - 7/8."
0AF9: samp say_msg "/givegun %s gun" [email protected]
0AF9: samp say_msg "Vei primi un 'SD-Pistol', te rog sa tragi toate gloantele jos."
0aF9: samp say_msg "Te rog sa-mi platesti restul de bani, mai ai de platit 2,000,000$."


else
print "~y~/g7 <id-ul jucatorului>" 2000
end
SAMP.CmdRet()

:cmd_13
SAMP.IsCommandTyped([email protected])
if
0AD4: [email protected] = scan_string [email protected] format "%d" [email protected]
then
0B36: samp [email protected] = get_player_nickname [email protected]
chatmsg "{408080}InstructorCMD: Licenta gun - 8/8."
0AF9: samp say_msg "/givelicence %s gun" [email protected]
0AF9: samp say_msg "Felicitari, ai obtinut licenta 'Gun', aceasta este valabila 100 de payday-uri."


else
print "~y~/g8 <id-ul jucatorului>" 2000
end
SAMP.CmdRet()


:cmd_14
SAMP.IsCommandTyped([email protected])
chatmsg "{408080}InstructorCMD: Licenta fly - 1/5."
0AF9: samp say_msg "Salut, sunt membrul factiunii School Instructors LV si te voi ajuta sa obtii licenta de 'Fly'."
0AF9: samp say_msg "Pentru inceput tasteaza comanda [/sl SkyLon] pentru a-ti verifica licentele."
SAMP.CmdRet()

:cmd_16
SAMP.IsCommandTyped([email protected])
chatmsg "{408080}InstructorCMD: Licenta fly - 2/5."
0AF9: samp say_msg "Acum trebuie sa-mi platesti 2,000,000$."
SAMP.CmdRet()

:cmd_17
SAMP.IsCommandTyped([email protected])
if
0AD4: [email protected] = scan_string [email protected] format "%d" [email protected]
then
0B36: samp [email protected] = get_player_nickname [email protected]
chatmsg "{408080}InstructorCMD: Licenta fly - 3/5."
0AF9: samp say_msg "/startlesson %s" [email protected]
0AF9: samp say_msg "Acum te rog sa apesi tasta 'F' pentru a urca in elicopter/avion."


else
print "~y~/f3 <id-ul jucatorului>" 2000
end
SAMP.CmdRet()

:cmd_18
SAMP.IsCommandTyped([email protected])
chatmsg "{408080}InstructorCMD: Licentã fly - 4/5."
0AF9: say_msg "Trebuie sa mergi in fata cativa metri, pentru a vira stanga sau [...]"
0AF9: say_msg "[...] dreapta, foloseste tasta 'A', respectiv 'D'."
SAMP.CmdRet



:cmd_19
SAMP.IsCommandTyped([email protected])
if
0AD4: [email protected] = scan_string [email protected] format "%d" [email protected]
then
0B36: samp [email protected] = get_player_nickname [email protected]
chatmsg "{408080}InstructorCMD: Licenta fly - 5/5."
0AF9: samp say_msg "/givelicence %s fly" [email protected]
0AF9: samp say_msg "Felicitari, ai obtiunut licenta 'Fly', aceasta este valabila 100 de payday-uri."


else
print "~y~/f5 <id-ul jucatorului>" 2000
end
SAMP.CmdRet()

:cmd_20
SAMP.IsCommandTyped([email protected])
chatmsg "{408080}InstructorCMD: Licentã boat - 1/5."
0AF9: samp say_msg "Salut, sunt membrul factiunii School Instructors LV si te voi ajuta sa obtii licenta de 'Boat'."
0AF9: samp say_msg "Pentru inceput tasteaza comanda [/sl SkyLon] pentru a-ti verifica licentele."
SAMP.CmdRet

:cmd_22
SAMP.IsCommandTyped([email protected])
chatmsg "{408080}InstructorCMD: Licentã boat - 2/5."
0AF9: say_msg "Acum trebuie sa-mi platesti 1,000,000$."
SAMP.CmdRet

:cmd_23
SAMP.IsCommandTyped([email protected])
if
0AD4: [email protected] = scan_string [email protected] format "%d" [email protected]
then
0B36: samp [email protected] = get_player_nickname [email protected]
chatmsg "{408080}InstructorCMD: Licenta boat - 3/5."
0AF9: samp say_msg "/startlesson %s." [email protected]
0AF9: samp say_msg "Acum te rog sa apesi tasta 'F' pentru a urca in barca."


else
print "~y~/b3 <id-ul jucatorului>" 2000
end
SAMP.CmdRet()

:cmd_24
SAMP.IsCommandTyped([email protected])
chatmsg "{408080}InstructorCMD: Licentã boat - 4/5."
0AF9: say_msg "Trebuie sa mergi in fata cativa metri, pentru a vira stanga sau [...]"
0AF9: say_msg "[...] dreapta, foloseste tasta 'A', respectiv 'D'."
SAMP.CmdRet

:cmd_25
SAMP.IsCommandTyped([email protected])
if
0AD4: [email protected] = scan_string [email protected] format "%d" [email protected]
then
0B36: samp [email protected] = get_player_nickname [email protected]
chatmsg "{408080}InstructorCMD: Licenta boat - 5/5."
0AF9: samp say_msg "/givelicence %s boat" [email protected]
0AF9: samp say_msg "Felicitari, ai obtiunut licenta 'Boat', aceasta este valabila 100 de payday-uri."


else
print "~y~/b5 <id-ul jucatorului>" 2000
end
SAMP.CmdRet()

:cmd_26
SAMP.IsCommandTyped([email protected])
chatmsg "{408080}InstructorCMD: Anuntul: Ofer licente autorizate: Gun(4,000,000$), Fly(2,000,000$), Boat(1,000,000$), minim nivel 3!"
chatmsg "{408080}Info: Trebuie sa te aflii la un CNN."
0AF9: say_msg "/ad Ofer licente autorizate: Gun(4,000,000$), Fly(2,000,000$), Boat(1,000,000$), minim nivel 3!"
SAMP.CmdRet

:cmd_27
SAMP.IsCommandTyped([email protected])
0AF9: say_msg "Ofer licente autorizate: Gun(4,000,000$), Fly(2,000,000$), Boat(1,000,000$), minim nivel 3!"
SAMP.CmdRet

:cmd_28
SAMP.IsCommandTyped([email protected])
if
0AD4: [email protected] = scan_string [email protected] format "%d" [email protected]
then
0B36: samp [email protected] = get_player_nickname [email protected]
0AF9: samp say_msg "/in %s doreste licenta de arme, contactati-l." [email protected]


else
print "~y~/guni <id-ul jucatorului>" 2000
end
SAMP.CmdRet()

:cmd_29
SAMP.IsCommandTyped([email protected])
if
0AD4: [email protected] = scan_string [email protected] format "%d" [email protected]
then
0B36: samp [email protected] = get_player_nickname [email protected]
0AF9: samp say_msg "/in %s doreste licenta de zbor, contactati-l." [email protected]


else
print "~y~/flyi <id-ul jucatorului>" 2000
end
SAMP.CmdRet()

:cmd_30
SAMP.IsCommandTyped([email protected])
if
0AD4: [email protected] = scan_string [email protected] format "%d" [email protected]
then
0B36: samp [email protected] = get_player_nickname [email protected]
0AF9: samp say_msg "/in %s doreste licenta de boat, contactati-l" [email protected]


else
print "~y~/boati <id-ul jucatorului>" 2000
end
SAMP.CmdRet()


:cmd_31
SAMP.IsCommandTyped([email protected])
if
0AD4: [email protected] = scan_string [email protected] format "%d" [email protected]
then
0B36: samp [email protected] = get_player_nickname [email protected]
0AF9: samp say_msg "/in %s doreste toate licentele, contactati-l" [email protected]


else
print "~y~/toatei <id-ul jucatorului>" 2000
end
SAMP.CmdRet()


:cmd_33
SAMP.IsCommandTyped([email protected])
if
0AD4: [email protected] = scan_string [email protected] format "%d" [email protected]
then
0B36: samp [email protected] = get_player_nickname [email protected]
0AF9: samp say_msg "/f %s doreste licenta de arme, contactati-l" [email protected]


else
print "~y~/gunf <id-ul jucatorului>" 2000
end
SAMP.CmdRet()


:cmd_34
SAMP.IsCommandTyped([email protected])
if
0AD4: [email protected] = scan_string [email protected] format "%d" [email protected]
then
0B36: samp [email protected] = get_player_nickname [email protected]
0AF9: samp say_msg "/f %s doreste licenta de zbor, contactati-l" [email protected]


else
print "~y~/flyf <id-ul jucatorului>" 2000
end
SAMP.CmdRet()


:cmd_35
SAMP.IsCommandTyped([email protected])
if
0AD4: [email protected] = scan_string [email protected] format "%d" [email protected]
then
0B36: samp [email protected] = get_player_nickname [email protected]
0AF9: samp say_msg "/f %s doreste licenta de barci, contactati-l" [email protected]


else
print "~y~/boatf <id-ul jucatorului>" 2000
end
SAMP.CmdRet()

:cmd_36
SAMP.IsCommandTyped([email protected])
if
0AD4: [email protected] = scan_string [email protected] format "%d" [email protected]
then
0B36: samp [email protected] = get_player_nickname [email protected]
0AF9: samp say_msg "/f %s doreste toate licentele, contactati-l" [email protected]


else
print "~y~/toatef <id-ul jucatorului>" 2000
end
SAMP.CmdRet()



:cmd_37
SAMP.IsCommandTyped([email protected])
0AF9: say_msg "/f Ma ocup eu de client, multumesc!"
SAMP.CmdRet


:cmd_38
SAMP.IsCommandTyped([email protected])
chatmsg "Sunt afisate modificarile efectuate in update-ul actual."
chatmsg "{408080}-----------------------------------------------------------------------------------------------------------"
chatmsg "{FFFFFF}Au fost modificate unele comenzi, mai multe detalii pe forum la topicul 'Instructor CMD'."
chatmsg "{FFFFFF}Instructor CMD a fost actualizat dupa modificarile de pe forum."
chatmsg "{408080}-----------------------------------------------------------------------------------------------------------"
SAMP.CmdRet


:chatmsg
0AA2: [email protected] = load_library "samp.dll" // IF and SET
chatmsg "{0080ff}InstructorCMD creat de FakeeRrR."
0085: [email protected] = [email protected] // (int)
[email protected] += 2203876
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 1
0085: [email protected] = [email protected] // (int)
[email protected] += 409616
0AB2: ret 0


The problem is that when I type the / g3 command and then / g4 immediately the server mutes me 30 seconds. What can I do to fix this?
 

Zin

Well-Known Member
Joined
Aug 1, 2013
Messages
1,696
Likes
111
Points
208
Website
youtube.com
#2
Just use "WAIT" between say msg. Also embed "your" code so it's easier to read thanks.
 

Zin

Well-Known Member
Joined
Aug 1, 2013
Messages
1,696
Likes
111
Points
208
Website
youtube.com
#7
You have to put a wait between each individual "say msg" as every "say msg" is you writing a line and in CLEO without WAIT things happen in literal seconds. Also don't put an enormous "WAIT" like 100000 as that's just gonna cause issues if you're spamming the CMD, put like 500 or 1000 as the server is muting you because you write like 2-4 messages in under a second.
 
OP
OP
R
Joined
Mar 20, 2020
Messages
21
Likes
0
Points
1
Location
Romania
1
#8
You have to put a wait between each individual "say msg" as every "say msg" is you writing a line and in CLEO without WAIT things happen in literal seconds. Also don't put an enormous "WAIT" like 100000 as that's just gonna cause issues if you're spamming the CMD, put like 500 or 1000 as the server is muting you because you write like 2-4 messages in under a second.
Like this?
 

Attachments

KamikazeSripterul

Well-Known Member
Joined
Jun 30, 2019
Messages
325
Likes
25
Points
33
#9
It doesn't matter how much waiting time you assign to the code. The server has it's own anti-spam system. This will allow you to type 15commands/5sec. This is why your code doesn't work. In fact, your code does work but the server has anti spam system.
 
OP
OP
R
Joined
Mar 20, 2020
Messages
21
Likes
0
Points
1
Location
Romania
1
#11
It doesn't matter how much waiting time you assign to the code. The server has it's own anti-spam system. This will allow you to type 15commands/5sec. This is why your code doesn't work. In fact, your code does work but the server has anti spam system.
So whatever I do, it can t be fixed?
 

Zin

Well-Known Member
Joined
Aug 1, 2013
Messages
1,696
Likes
111
Points
208
Website
youtube.com
#14
Kamikaze is right. I think it can t be fixed.
Well no the anti-spam does have it's limits and usually would allow you to send 1 cmd per second. In that photo you put you only had added the "WAITS" to 1 command whereas you need to do it to the other command you talked about using.
 
OP
OP
R
Joined
Mar 20, 2020
Messages
21
Likes
0
Points
1
Location
Romania
1
#15
Well no the anti-spam does have it's limits and usually would allow you to send 1 cmd per second. In that photo you put you only had added the "WAITS" to 1 command whereas you need to do it to the other command you talked about using.
Not working.
 

Zin

Well-Known Member
Joined
Aug 1, 2013
Messages
1,696
Likes
111
Points
208
Website
youtube.com
#16
Ok turns "WAIT" doesn't work with a client command. You have to do it like this.
C++:
{$CLEO .cs}

THREAD 'CMD'

REPEAT
    WAIT 0
UNTIL 0AFA:

0B34: samp register_client_command "CMD" to_label @CMD

WHILE TRUE
    WAIT 0
    IF
        [email protected] == TRUE
    THEN
        CHATMSG "TEST" 0xFF0000
        WAIT 1000
        CHATMSG "TEST" 0x00FF00
        WAIT 1000
        CHATMSG "TEST" 0x0000FF
        WAIT 1000
        [email protected] = FALSE
    END
END

:CMD
[email protected] = TRUE
SAMP.CmdRet()
 
OP
OP
R
Joined
Mar 20, 2020
Messages
21
Likes
0
Points
1
Location
Romania
1
#18
Ok turns "WAIT" doesn't work with a client command. You have to do it like this.
C++:
{$CLEO .cs}

THREAD 'CMD'

REPEAT
    WAIT 0
UNTIL 0AFA:

0B34: samp register_client_command "CMD" to_label @CMD

WHILE TRUE
    WAIT 0
    IF
        [email protected] == TRUE
    THEN
        CHATMSG "TEST" 0xFF0000
        WAIT 1000
        CHATMSG "TEST" 0x00FF00
        WAIT 1000
        CHATMSG "TEST" 0x0000FF
        WAIT 1000
        [email protected] = FALSE
    END
END

:CMD
[email protected] = TRUE
SAMP.CmdRet()
I try this right now.
 
OP
OP
R
Joined
Mar 20, 2020
Messages
21
Likes
0
Points
1
Location
Romania
1
#19
Ok turns "WAIT" doesn't work with a client command. You have to do it like this.
C++:
{$CLEO .cs}

THREAD 'CMD'

REPEAT
    WAIT 0
UNTIL 0AFA:

0B34: samp register_client_command "CMD" to_label @CMD

WHILE TRUE
    WAIT 0
    IF
        [email protected] == TRUE
    THEN
        CHATMSG "TEST" 0xFF0000
        WAIT 1000
        CHATMSG "TEST" 0x00FF00
        WAIT 1000
        CHATMSG "TEST" 0x0000FF
        WAIT 1000
        [email protected] = FALSE
    END
END

:CMD
[email protected] = TRUE
SAMP.CmdRet()
Ok, this is working. how can I add more commands? I tried like this, but it is not working:
 

Attachments

KamikazeSripterul

Well-Known Member
Joined
Jun 30, 2019
Messages
325
Likes
25
Points
33
#20
Ok so.. You're not supposed to put WHILE TRUE in a label. A label is basically :cmd, something that defined a block of code. In this case, you put a loop in a label which won't work very well.
To make it more clear (at least i'll try to) what you are essentially doing is using a command (in this case /CMD) to change the variable [email protected] In the loop, if the variable [email protected] is true (as set in the command /CMD), it will do a line of code, in this case 'chatmsg "TEST" 0xff0000. So what you want to do, using commands like /g1, /g2 etc. you change the variable. On my RP server, there are only 9 needed commands for licences gun. This means you can use variable [email protected] for licence gun, [email protected] for licence boat and [email protected] for licence fly. Using commands like /g1, /g2, change the variable to 1, 2 etc. If the variable is 1, then it will type the first part of the test. If the variable is 2, it will type the second part of the test. Use this to get through your code. Goodluck!
 
Top