Simple Command

Статус
В этой теме нельзя размещать новые ответы.

SanGiovanni

Новичок
Автор темы
25
0
How do i create a cleo with a simple command?


Код:
// This file was decompiled using sascm.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013

{$VERSION 3.1.1000}
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP 
if 
0@ = SAMP.Base()
else_jump @Noname_62 

:Noname_18
   not SAMP.Available
else_jump @Noname_39 
wait 500 
jump @Noname_18 

:Noname_39
0B34: samp register_client_command "pcarc" to_label @Noname_75 
jump @bagnarola

:Noname_62
end_thread 

:bagnarola
 wait 100

:Noname_75
   SAMP.IsCommandTyped(0@)
if 
0AD4: 2@ 0@ format "%f" 1@  
else_jump @bagnarola

:Noname_142
0AF9: samp say_msg "/me test"
0AF9: samp say_msg "/spawncar"



:Noname_977
SAMP.CmdRet
 

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,468
Код:
{$CLEO}

0001: wait 0 ms

repeat
   wait 400
until 0AFA: is_samp_available

0B34: samp register_client_command "pcarc" to_label @cmd

while true
    wait 0
end

:cmd
SAMP.IsCommandTyped(0@)
if
   0AD4: 2@ = 0@ format "%f" 1@
then
   0AF9: samp say_msg "/me test"
   0AF9: samp say_msg "/spawncar"
end
0B43: samp cmd_ret
 
  • Нравится
Реакции: SanGiovanni

SanGiovanni

Новичок
Автор темы
25
0
Thank you, I tried this

EDIT: Solved!

Thank you again :)
 
Последнее редактирование:

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,468
Emm... Opcode 0AD4 don't so work(scan string for text)
Код:
:cmd
SAMP.IsCommandTyped(0@)
0AF9: samp say_msg "/me test %s" 0@
0B43: samp cmd_ret
 
  • Нравится
Реакции: SanGiovanni

SanGiovanni

Новичок
Автор темы
25
0
Ok, but what if i want to put a name in a global variable?


like

Код:
10@ = "MyName"                          <------- Error here
:cmd
SAMP.IsCommandTyped(0@)
0AF9: samp say_msg "/me test %s bla bla bla %s" 0@ 10@
0B43: samp cmd_ret
 

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,468
Allocate memory and use opcode 0ad3:
Код:
0AC8: 10@ = allocate_memory_size 64
0AD3: 10@ = format "MyName"
0AF9: samp say_msg "/me test %s bla bla bla %s" 0@ 10@
0AC9: free_allocated_memory 10@
 
  • Нравится
Реакции: SanGiovanni

SanGiovanni

Новичок
Автор темы
25
0
I want it to be a Global Variable to change it afterward



Код:
{$CLEO}

0001: wait 0 ms

repeat
   wait 400
until 0AFA: is_samp_available

0B34: samp register_client_command "fcen" to_label @cmd
0B34: samp register_client_command "fname" to_label @cmdFname


0AC8: 0@ = allocate_memory_size 64
0AC9: free_allocated_memory 0@

0AC8: 10@ = allocate_memory_size 64

0AD3: 10@ = format "MyName"


while true
    wait 0
end


:cmd
SAMP.IsCommandTyped(0@)
if
   0AD4: 2@ = 0@ format "%s" 1@
then
 
0AF9: samp say_msg "/me test %s bla bla bla %s" 0@ 10@                                                       <- use it here
 
end

0B43: samp cmd_ret


:cmdFname
SAMP.IsCommandTyped(10@)                                      <------- I want to change 10@ here and use it ↑
0B43: samp cmd_ret
 

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,468
Код:
:cmdFname
SAMP.IsCommandTyped(0@)
0C11: memset destination 10@ value 0 size 64
0C13: strcpy destination 10@ source 0@
0B43: samp cmd_ret

Oh... and why you again use 0ad4 not as I said?
 
  • Нравится
Реакции: SanGiovanni

SanGiovanni

Новичок
Автор темы
25
0
Thank you it's working all now :)

Just the
Код:
wait 10000
isn't working

Код:
:cmdALFA



   0AF9: samp say_msg "ALFA ALFA"
   wait 10000                                                  
   0AF9: samp say_msg "BETA BETA"    


0B43: samp cmd_ret


makes this:

8tjUfPg.png
 

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,468
"Wait" not working in SAMPFUNCS' commands.
To do this, use cycle "while true".
 

mac

HEY DARLING
1,317
911
What I have to put with while true?


Код:
:cmdALFA



0AF9: samp say_msg "ALFA ALFA"
while true ...
0AF9: samp say_msg "BETA BETA"


0B43: samp cmd_ret
Код:
{$CLEO .cs}
0000:
wait 3500
0b34: "noob" @noobstart

while true
if
0@ == 1
then
0AF9: samp say_msg "ALFA ALFA"
wait 10000
0AF9: samp say_msg "BETA BETA"
0@ = 0
end
end

:noobstart
if
0@ == 0
then
0@ = 1
else
0@ = 0
end
cmdret
 
Статус
В этой теме нельзя размещать новые ответы.