Rough
Active member
- Joined
- Mar 7, 2015
- Messages
- 42
- Reaction score
- 4
Hello.. I have a problem.. I'm trying to make a mod which scan a string and get for exemple 7 numbers from it, then use it as /call ..
take a look and can you please tell me what I am doing wrong? I mean, maybe I didn't understand very well how to scan strang and get numbers from it but i'd like to learn. Thank you very much! appreciate!
// I was thinking to make it write into .ini the number then read it from .ini file.. but I don't know how to get info from string exactly and then write it elsewhere.. And I also don't understand how alocating memory works.. Thank you very much!
take a look and can you please tell me what I am doing wrong? I mean, maybe I didn't understand very well how to scan strang and get numbers from it but i'd like to learn. Thank you very much! appreciate!
Code:
0B34: samp register_client_command "call" to_label @call
//0AF8: samp add_message_to_chat "{660000}autosms..cs - Working" color 0x660000
wait 1000
thread "autocall"
:Noname_05
wait 0
jump @Noname_05
:call
SAMP.IsCommandTyped(0@)
IF 0AD4: 1@ = scan_string 0@ format "%d" 2@
JF @ERROR
IF SAMP.IsPlayerConnected(2@)
JF @ERROR_2
3@ = SAMP.GetPlayerNickname(2@)
Say "/number %s" 3@
jump @scan
SAMP.CmdRet
: scan
alloc 0@ = 145
alloc 1@ = 25
0B75: samp get_chat_string 99 text_to 0@ prefix_to 1@ color_to -1 prefix_color_to -1 //citesti linia din chat, 99 = ultima
if
0C29: 3@ = stristr string1 0@ string2 "{999999}Name: %s, Phone number: %s%s%s-%s%s%s%s" 5@ 6@ 7@ 8@ 9@ 10@ 11@ 12@ //cauti un string in alt string, cauti \'potato\' in ultimul mesaj din chat
then
Say "/call %s%s%s%s%s%s%s" 6@ 7@ 8@ 9@ 10@ 11@ 12@
end
free 0@
free 1@
:error
chatmsg "nu-i buna sintaxa, iti tre' un id" -1
samp.CmdRet()
:error_2
chatmsg "crash" -1
samp.CmdRet()
// I was thinking to make it write into .ini the number then read it from .ini file.. but I don't know how to get info from string exactly and then write it elsewhere.. And I also don't understand how alocating memory works.. Thank you very much!