Help me please, I need to fix this cmd!

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(20@)
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(20@)
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(20@)
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(20@)
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(20@)
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(20@)
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(20@)
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(20@)
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(20@)
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(20@)
chatmsg "{408080}InstructorCMD:Licenta gun - 6/8."
0AF9: samp say_msg "3. Poti face DM pe 'clan turf'?"
SAMP.CmdRet

:cmd_12
SAMP.IsCommandTyped(20@)
if
0AD4: 20@ = scan_string 20@ format "%d" 21@
then
0B36: samp 1@ = get_player_nickname 21@
chatmsg "{408080}InstructorCMD: Licenta gun - 7/8."
0AF9: samp say_msg "/givegun %s gun" 1@
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(20@)
if
0AD4: 20@ = scan_string 20@ format "%d" 21@
then
0B36: samp 1@ = get_player_nickname 21@
chatmsg "{408080}InstructorCMD: Licenta gun - 8/8."
0AF9: samp say_msg "/givelicence %s gun" 1@
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(20@)
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(20@)
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(20@)
if
0AD4: 20@ = scan_string 20@ format "%d" 21@
then
0B36: samp 1@ = get_player_nickname 21@
chatmsg "{408080}InstructorCMD: Licenta fly - 3/5."
0AF9: samp say_msg "/startlesson %s" 1@
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(20@)
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(20@)
if
0AD4: 20@ = scan_string 20@ format "%d" 21@
then
0B36: samp 1@ = get_player_nickname 21@
chatmsg "{408080}InstructorCMD: Licenta fly - 5/5."
0AF9: samp say_msg "/givelicence %s fly" 1@
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(20@)
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(20@)
chatmsg "{408080}InstructorCMD: Licentã boat - 2/5."
0AF9: say_msg "Acum trebuie sa-mi platesti 1,000,000$."
SAMP.CmdRet

:cmd_23
SAMP.IsCommandTyped(20@)
if
0AD4: 20@ = scan_string 20@ format "%d" 21@
then
0B36: samp 1@ = get_player_nickname 21@
chatmsg "{408080}InstructorCMD: Licenta boat - 3/5."
0AF9: samp say_msg "/startlesson %s." 1@
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(20@)
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(20@)
if
0AD4: 20@ = scan_string 20@ format "%d" 21@
then
0B36: samp 1@ = get_player_nickname 21@
chatmsg "{408080}InstructorCMD: Licenta boat - 5/5."
0AF9: samp say_msg "/givelicence %s boat" 1@
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(20@)
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(20@)
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(20@)
if
0AD4: 20@ = scan_string 20@ format "%d" 21@
then
0B36: samp 1@ = get_player_nickname 21@
0AF9: samp say_msg "/in %s doreste licenta de arme, contactati-l." 1@


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

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


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

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


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


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


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


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


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


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


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


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


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

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


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



:cmd_37
SAMP.IsCommandTyped(20@)
0AF9: say_msg "/f Ma ocup eu de client, multumesc!"
SAMP.CmdRet


:cmd_38
SAMP.IsCommandTyped(20@)
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: 0@ = load_library "samp.dll" // IF and SET
chatmsg "{0080ff}InstructorCMD creat de FakeeRrR."
0085: 1@ = 0@ // (int)
1@ += 2203876
0A8D: 3@ = read_memory 1@ size 4 virtual_protect 1
0085: 2@ = 0@ // (int)
2@ += 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

Expert
Joined
Aug 1, 2013
Messages
1,690
Reaction score
103
Just use "WAIT" between say msg. Also embed "your" code so it's easier to read thanks.
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,690
Reaction score
103
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.
 

Radu15

Member
Joined
Mar 20, 2020
Messages
21
Reaction score
0
Location
Romania
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

  • 2020-04-12 16_22_20-Greenshot.png
    2020-04-12 16_22_20-Greenshot.png
    137.1 KB · Views: 9

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
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.
 

Radu15

Member
Joined
Mar 20, 2020
Messages
21
Reaction score
0
Location
Romania
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

Expert
Joined
Aug 1, 2013
Messages
1,690
Reaction score
103
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.
 

Radu15

Member
Joined
Mar 20, 2020
Messages
21
Reaction score
0
Location
Romania
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

Expert
Joined
Aug 1, 2013
Messages
1,690
Reaction score
103
Not working.
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
        0@ == TRUE
    THEN
        CHATMSG "TEST" 0xFF0000
        WAIT 1000
        CHATMSG "TEST" 0x00FF00
        WAIT 1000
        CHATMSG "TEST" 0x0000FF
        WAIT 1000
        0@ = FALSE
    END
END

:CMD
0@ = TRUE
SAMP.CmdRet()
 

Radu15

Member
Joined
Mar 20, 2020
Messages
21
Reaction score
0
Location
Romania
I put the two commands / g3 and / g4 in one which is / g3, how can I put a waiting time between the 3rd sentence and the 4th sentence? I don t know why this is not working:
Can anyone hel me?
 

Attachments

  • 2020-04-12 17_08_28-Greenshot.png
    2020-04-12 17_08_28-Greenshot.png
    139.6 KB · Views: 3

Radu15

Member
Joined
Mar 20, 2020
Messages
21
Reaction score
0
Location
Romania
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
        0@ == TRUE
    THEN
        CHATMSG "TEST" 0xFF0000
        WAIT 1000
        CHATMSG "TEST" 0x00FF00
        WAIT 1000
        CHATMSG "TEST" 0x0000FF
        WAIT 1000
        0@ = FALSE
    END
END

:CMD
0@ = TRUE
SAMP.CmdRet()

I try this right now.
 

Radu15

Member
Joined
Mar 20, 2020
Messages
21
Reaction score
0
Location
Romania
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
        0@ == TRUE
    THEN
        CHATMSG "TEST" 0xFF0000
        WAIT 1000
        CHATMSG "TEST" 0x00FF00
        WAIT 1000
        CHATMSG "TEST" 0x0000FF
        WAIT 1000
        0@ = FALSE
    END
END

:CMD
0@ = TRUE
SAMP.CmdRet()

Ok, this is working. how can I add more commands? I tried like this, but it is not working:
 

Attachments

  • 2020-04-14 11_04_25-Greenshot.png
    2020-04-14 11_04_25-Greenshot.png
    102.8 KB · Views: 6

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
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 0@. In the loop, if the variable 0@ 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 0@ for licence gun, 1@ for licence boat and 2@ 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