- 2
- 0
how can i make this script run the / sms id command without crashing
1Word (1)'s phone number is {FF0000}997666{FFFFFF}.
How do I change everything to be able to act on the text above [1Word (1)] is the name and id of the person I want to send a message to and 997666 is his number. What changes need to be made to make it work?
{$CLEO}
{$INCLUDE SF}
0000:
repeat
wait 0
until SAMP.Available()
0b34: "smart" @rr
alloc 8@ 256
0C11: memset destination 8@ value 0 size 256
alloc 17@ 256
0C11: memset destination 17@ value 0 size 256
//0B39: samp get_current_server_address 8@ port $PORT
//if 8c14: 8@ "193.203.39.42"
//then
// 004E: end_thread
//end
14@ = 0
chatmsg "{313131}[K] {f9fafc}SmartPhone loaded. Have fun!" -1
chatmsg "{B00D23}>> [/smart{B00D23}] for commands <<" -1
0C11: memset destination 8@ value 0 size 256
0BE3: raknet setup_incoming_rpc_hook @chat_number
0BE1: raknet setup_outcoming_rpc_hook @out_phone
while true
wait 0
if and
14@ == 1
32@ == 60000
then
14@ = 0
end
if 18@ == 1
then
say "/call 112"
wait 250
say "LSPD"
18@ = 2
end
END
:out_phone
0BE5: raknet 0@ = get_hook_param PARAM_PACKETID
if 0@ == RPC_SERVERCOMMAND
then
0BE5: raknet 1@ = get_hook_param PARAM_BITSTREAM
0BE7: raknet 2@ = bit_stream_read 1@ type BS_TYPE_INT
alloc 3@ 1024
0C11: memset destination 3@ value 0 size 1024
0BE8: raknet bit_stream 1@ read_array 3@ size 2@
0C1E: array 3@ element 2@ el_size 1 = 0
if 0C18: $NOT_STRING = strstr string1 3@ string2 "/sms"
then
alloc 15@ 128
alloc 13@ 128
0AA7: call 0x8220AD num_params 4 pop 4 13@ 15@ "/sms %s %s" 3@ 11@
if 11@ == 2
then
0C17: 16@ = strlen 15@
if 16@ <= 3
then
0AA5: call 0x8220AD num_params 4 pop 4 7@v 4@v "/sms %d %n" 3@
005a: 7@ += 3@
if SAMP.IsPlayerConnected(4@)
then
if 003b: 9@ == 4@
then
say "/sms %s %s" 8@ 7@
else
say "/number %d" 4@
6@ = 1
end
0BE0: raknet hook_ret false
end
end
end
free 15@
free 13@
end
if 0C18: $NOT_STRING = strstr string1 3@ string2 "/reply"
then
alloc 13@ 128
0AA7: call 0x8220AD num_params 3 pop 3 13@ "/reply %s" 3@ 11@
if 11@ == 1
then
0AA5: call 0x8220AD num_params 3 pop 3 7@v "/reply %n" 3@
005a: 7@ += 3@
say "/sms %s %s" 17@ 7@
0BE0: raknet hook_ret false
end
free 13@
end
if and
not 17@ == 1
0C18: $NOT_STRING = strstr string1 3@ string2 "/call"
then
alloc 13@ 128
0AA7: call 0x8220AD num_params 3 pop 3 13@ "/call %s" 3@ 11@
if 11@ == 1
then
if 0c14: 13@ "LSPD"
then
18@ = 1
0BE0: raknet hook_ret false
else
if and
0c14: 13@ "112"
14@ == 1
then
14@ = 0
else
0C17: 11@ = strlen 13@
if 11@ <= 3
then
0C1A: 4@ = atoi 13@
if SAMP.IsPlayerConnected(4@)
then
say "/number %d" 4@
6@ = 2
0BE0: raknet hook_ret false
end
end
end
end
end
free 13@
end
free 3@
end
0BE0: raknet hook_ret true
:chat_number
0BE5: raknet 31@ = get_hook_param PARAM_PACKETID
if 31@ == RPC_ScrClientMessage
then
alloc 27@ 256
0C11: memset destination 27@ value 0 size 256
0BE5: raknet 30@ = get_hook_param PARAM_BITSTREAM
0BE7: raknet 29@ = bit_stream_read 30@ type BS_TYPE_INT //color
0BE7: raknet 28@ = bit_stream_read 30@ type BS_TYPE_INT //lenght
0BE8: raknet bit_stream 30@ read_array 27@ size 28@
0C0D: struct 27@ offset 28@ size 1 = 0
if 0C18: $NOT_STRING = strstr string1 27@ string2 "Number:"
then
if 6@ == 1
then
alloc 5@ 256
0C11: memset destination 5@ value 0 size 256
0AA5: call 0x8220AD num_params 3 pop 3 5@ "%*[^:]: %*[^|]| %*[^:]: %s" 27@
5@ += 8
format 8@ "%s" 5@
say "/sms %s %s" 8@ 7@
0085: 9@ = 4@
5@ -= 8
6@ = 3
free 5@
0BE0: raknet hook_ret false
else
if 6@ == 2
then
alloc 12@ 128
0C11: memset destination 12@ value 0 size 128
0AA5: call 0x8220AD num_params 3 pop 3 12@ "%*[^:]: %*[^|]| %*[^:]: %s" 27@
12@ += 8
say "/call %s" 12@
12@ -= 8
6@ = 0
free 12@
0BE0: raknet hook_ret false
end
end
end
if 0C18: $NOT_STRING = strstr string1 27@ string2 "SMS from"
then
alloc 5@ 256
0C11: memset destination 5@ value 0 size 256
0AA5: call 0x8220AD num_params 3 pop 3 5@ "%*[^(] %*[( ]%[^)]): %*s" 27@
format 17@ "%s" 5@
free 5@
end
if or
0C18: $NOT_STRING = strstr string1 27@ string2 "You have 60 seconds to use /call 112"
0C18: $NOT_STRING = strstr string1 27@ string2 "Ai 60 de secunde sa folosesti /call 112"
then
32@ = 0
14@ = 1
end
if 18@ >= 1
then
if 0C18: $NOT_STRING = strstr string1 27@ string2 "LSPD"
then
0BE0: raknet hook_ret false
else
if 0C18: $NOT_STRING = strstr string1 27@ string2 "112"
then
18@ = 0
end
end
end
free 27@
end
0BE0: raknet hook_ret true
:rr
chatmsg "{B00D23}-------------------------------------------" -1
chatmsg "{313131}•{2F59A7} [{f9fafc}/sms <ID> <Mesaj>{2F59A7}]" -1
chatmsg "{313131}•{2F59A7} [{f9fafc}/reply <Mesaj>{2F59A7}]" -1
chatmsg "{B00D23}-------------------------------------------" -1
SAMP.CmdRet()
[/CODE]
1Word (1)'s phone number is {FF0000}997666{FFFFFF}.
How do I change everything to be able to act on the text above [1Word (1)] is the name and id of the person I want to send a message to and 997666 is his number. What changes need to be made to make it work?
{$CLEO}
{$INCLUDE SF}
0000:
repeat
wait 0
until SAMP.Available()
0b34: "smart" @rr
alloc 8@ 256
0C11: memset destination 8@ value 0 size 256
alloc 17@ 256
0C11: memset destination 17@ value 0 size 256
//0B39: samp get_current_server_address 8@ port $PORT
//if 8c14: 8@ "193.203.39.42"
//then
// 004E: end_thread
//end
14@ = 0
chatmsg "{313131}[K] {f9fafc}SmartPhone loaded. Have fun!" -1
chatmsg "{B00D23}>> [/smart{B00D23}] for commands <<" -1
0C11: memset destination 8@ value 0 size 256
0BE3: raknet setup_incoming_rpc_hook @chat_number
0BE1: raknet setup_outcoming_rpc_hook @out_phone
while true
wait 0
if and
14@ == 1
32@ == 60000
then
14@ = 0
end
if 18@ == 1
then
say "/call 112"
wait 250
say "LSPD"
18@ = 2
end
END
:out_phone
0BE5: raknet 0@ = get_hook_param PARAM_PACKETID
if 0@ == RPC_SERVERCOMMAND
then
0BE5: raknet 1@ = get_hook_param PARAM_BITSTREAM
0BE7: raknet 2@ = bit_stream_read 1@ type BS_TYPE_INT
alloc 3@ 1024
0C11: memset destination 3@ value 0 size 1024
0BE8: raknet bit_stream 1@ read_array 3@ size 2@
0C1E: array 3@ element 2@ el_size 1 = 0
if 0C18: $NOT_STRING = strstr string1 3@ string2 "/sms"
then
alloc 15@ 128
alloc 13@ 128
0AA7: call 0x8220AD num_params 4 pop 4 13@ 15@ "/sms %s %s" 3@ 11@
if 11@ == 2
then
0C17: 16@ = strlen 15@
if 16@ <= 3
then
0AA5: call 0x8220AD num_params 4 pop 4 7@v 4@v "/sms %d %n" 3@
005a: 7@ += 3@
if SAMP.IsPlayerConnected(4@)
then
if 003b: 9@ == 4@
then
say "/sms %s %s" 8@ 7@
else
say "/number %d" 4@
6@ = 1
end
0BE0: raknet hook_ret false
end
end
end
free 15@
free 13@
end
if 0C18: $NOT_STRING = strstr string1 3@ string2 "/reply"
then
alloc 13@ 128
0AA7: call 0x8220AD num_params 3 pop 3 13@ "/reply %s" 3@ 11@
if 11@ == 1
then
0AA5: call 0x8220AD num_params 3 pop 3 7@v "/reply %n" 3@
005a: 7@ += 3@
say "/sms %s %s" 17@ 7@
0BE0: raknet hook_ret false
end
free 13@
end
if and
not 17@ == 1
0C18: $NOT_STRING = strstr string1 3@ string2 "/call"
then
alloc 13@ 128
0AA7: call 0x8220AD num_params 3 pop 3 13@ "/call %s" 3@ 11@
if 11@ == 1
then
if 0c14: 13@ "LSPD"
then
18@ = 1
0BE0: raknet hook_ret false
else
if and
0c14: 13@ "112"
14@ == 1
then
14@ = 0
else
0C17: 11@ = strlen 13@
if 11@ <= 3
then
0C1A: 4@ = atoi 13@
if SAMP.IsPlayerConnected(4@)
then
say "/number %d" 4@
6@ = 2
0BE0: raknet hook_ret false
end
end
end
end
end
free 13@
end
free 3@
end
0BE0: raknet hook_ret true
:chat_number
0BE5: raknet 31@ = get_hook_param PARAM_PACKETID
if 31@ == RPC_ScrClientMessage
then
alloc 27@ 256
0C11: memset destination 27@ value 0 size 256
0BE5: raknet 30@ = get_hook_param PARAM_BITSTREAM
0BE7: raknet 29@ = bit_stream_read 30@ type BS_TYPE_INT //color
0BE7: raknet 28@ = bit_stream_read 30@ type BS_TYPE_INT //lenght
0BE8: raknet bit_stream 30@ read_array 27@ size 28@
0C0D: struct 27@ offset 28@ size 1 = 0
if 0C18: $NOT_STRING = strstr string1 27@ string2 "Number:"
then
if 6@ == 1
then
alloc 5@ 256
0C11: memset destination 5@ value 0 size 256
0AA5: call 0x8220AD num_params 3 pop 3 5@ "%*[^:]: %*[^|]| %*[^:]: %s" 27@
5@ += 8
format 8@ "%s" 5@
say "/sms %s %s" 8@ 7@
0085: 9@ = 4@
5@ -= 8
6@ = 3
free 5@
0BE0: raknet hook_ret false
else
if 6@ == 2
then
alloc 12@ 128
0C11: memset destination 12@ value 0 size 128
0AA5: call 0x8220AD num_params 3 pop 3 12@ "%*[^:]: %*[^|]| %*[^:]: %s" 27@
12@ += 8
say "/call %s" 12@
12@ -= 8
6@ = 0
free 12@
0BE0: raknet hook_ret false
end
end
end
if 0C18: $NOT_STRING = strstr string1 27@ string2 "SMS from"
then
alloc 5@ 256
0C11: memset destination 5@ value 0 size 256
0AA5: call 0x8220AD num_params 3 pop 3 5@ "%*[^(] %*[( ]%[^)]): %*s" 27@
format 17@ "%s" 5@
free 5@
end
if or
0C18: $NOT_STRING = strstr string1 27@ string2 "You have 60 seconds to use /call 112"
0C18: $NOT_STRING = strstr string1 27@ string2 "Ai 60 de secunde sa folosesti /call 112"
then
32@ = 0
14@ = 1
end
if 18@ >= 1
then
if 0C18: $NOT_STRING = strstr string1 27@ string2 "LSPD"
then
0BE0: raknet hook_ret false
else
if 0C18: $NOT_STRING = strstr string1 27@ string2 "112"
then
18@ = 0
end
end
end
free 27@
end
0BE0: raknet hook_ret true
:rr
chatmsg "{B00D23}-------------------------------------------" -1
chatmsg "{313131}•{2F59A7} [{f9fafc}/sms <ID> <Mesaj>{2F59A7}]" -1
chatmsg "{313131}•{2F59A7} [{f9fafc}/reply <Mesaj>{2F59A7}]" -1
chatmsg "{B00D23}-------------------------------------------" -1
SAMP.CmdRet()
[/CODE]
Последнее редактирование: