monday
Expert
- Joined
- Jun 23, 2014
- Messages
- 1,127
- Solutions
- 1
- Reaction score
- 158
I don't know what is the reason but it seems like some variables get overwritten somehow when I use more than one command.
According to the code below. When I type "/firstcommand AAAAAAAA" it displays the AAAAAAA(1@) in the chat. Then I type "/secondcommand BBBBBBBBB" and it displays BBBBBBBB in the chat as 1@ and as 2@. 1@ which was AAAAAA gets replaced somehow with the data from other command
According to the code below. When I type "/firstcommand AAAAAAAA" it displays the AAAAAAA(1@) in the chat. Then I type "/secondcommand BBBBBBBBB" and it displays BBBBBBBB in the chat as 1@ and as 2@. 1@ which was AAAAAA gets replaced somehow with the data from other command
Code:
0B34: samp register_client_command "firstcommand" to_label @Label1
0B34: samp register_client_command "secondcommand" to_label @Label2
31@ = 0
:First
wait 0
if 31@ == 1
then
0AF8: samp add_message_to_chat 1@ color 0xFF4800
end
if 31@ == 2
then
0AF8: samp add_message_to_chat 1@ color 0xFF4800
0AF8: samp add_message_to_chat 2@ color 0xFF4800
:Label1
wait 0
0B35: samp 1@ = get_last_command_params
if 0AD4: 3@ = scan_string 1@ format "%s" 30@
then
31@ = 1
else
31@ = 0
end
samp.CmdRet
jump @First
:Label2
wait 0
0B35: samp 2@ = get_last_command_params
if 0AD4: 3@ = scan_string 2@ format "%s" 31@
then
31@ = 2
else
31@ = 0
end
samp.CmdRet
jump @First