{$CLEO .cs}
0000: NOP
WAIT 1000
:HELLOCHAT
wait 0
0AC8: 3@ = allocate_memory_size 260
0AB1: call @GETCHATTEXT 1 id 99 to 3@
if
0AD4: 4@ = scan_string 3@ format "----------- [Hello] -----------"
then
0AF9: "Whats up dude?"
end
jump @HELLOCHAT
001 said:thats the code:
Code:{$CLEO .cs} 0000: NOP WAIT 1000 :HELLOCHAT wait 0 0AC8: 3@ = allocate_memory_size 260 0AB1: call @GETCHATTEXT 1 id 99 to 3@ if 0AD4: 4@ = scan_string 3@ format "----------- [Hello] -----------" then 0AF9: "Whats up dude?" end jump @HELLOCHAT
{$CLEO}
{$INCLUDE SF}
0000:
repeat
wait 50
until 0AFA: is_samp_available
0B34: samp register_client_command "activate" to_label @activate
0BE3: raknet setup_incoming_rpc_hook @on_new_chatline
0AC8: 31@ = allocate_memory_size 260 //chatline
0AC8: 30@ = allocate_memory_size 260
27@ = 1 // makes the mod activated after launching the game
while true
wait 0
/*
if key_down 48
then
24@ = 1
end
*/
if and
27@ == 1
24@ == 1
then
24@ = 0
samp.GetChatString(99, 31@, 0, 0, 0)
//chatmsg "String detected: %s" -1 31@
if
//0AD4: 0@ = 31@ scan_string "hello %d" 29@ // the chatlog shows "<Michal_Monday> hello 15" but for some reason the "GetChatString" ignores the name (it doesn't happen when some other)
0C14: strcmp string1 31@ string2 "----------- [Hello] -----------"
then
//0AD3: 30@ = format "Command ready to be entered: /pm %d hello my friend" 29@
//chatmsg 30@ -1 // replace it with "say 30@"
say "Whats up dude?"
end
end
end
:activate
0B12: 27@ = 27@ XOR 1
if 27@ == 1
then
0AD1: show_formatted_text_highpriority "activated" time 700
else
0AD1: show_formatted_text_highpriority "deactivated" time 700
end
samp.CmdRet
:on_new_chatline
0BE5: raknet 23@ = get_hook_param PARAM_PACKETID
if 23@ == RPC_ScrClientMessage
then
24@ = 1
end
0BE0: raknet hook_ret true
Malchik said:001 said:thats the code:
Code:{$CLEO .cs} 0000: NOP WAIT 1000 :HELLOCHAT wait 0 0AC8: 3@ = allocate_memory_size 260 0AB1: call @GETCHATTEXT 1 id 99 to 3@ if 0AD4: 4@ = scan_string 3@ format "----------- [Hello] -----------" then 0AF9: "Whats up dude?" end jump @HELLOCHAT
Does it work for you?
monday said:@001
check this out man,
Code:{$CLEO} {$INCLUDE SF} 0000: repeat wait 50 until 0AFA: is_samp_available 0B34: samp register_client_command "activate" to_label @activate 0BE3: raknet setup_incoming_rpc_hook @on_new_chatline 0AC8: 31@ = allocate_memory_size 260 //chatline 0AC8: 30@ = allocate_memory_size 260 27@ = 1 // makes the mod activated after launching the game while true wait 0 /* if key_down 48 then 24@ = 1 end */ if and 27@ == 1 24@ == 1 then 24@ = 0 samp.GetChatString(99, 31@, 0, 0, 0) //chatmsg "String detected: %s" -1 31@ if //0AD4: 0@ = 31@ scan_string "hello %d" 29@ // the chatlog shows "<Michal_Monday> hello 15" but for some reason the "GetChatString" ignores the name (it doesn't happen when some other) 0C14: strcmp string1 31@ string2 "----------- [Hello] -----------" then //0AD3: 30@ = format "Command ready to be entered: /pm %d hello my friend" 29@ //chatmsg 30@ -1 // replace it with "say 30@" say "Whats up dude?" end end end :activate 0B12: 27@ = 27@ XOR 1 if 27@ == 1 then 0AD1: show_formatted_text_highpriority "activated" time 700 else 0AD1: show_formatted_text_highpriority "deactivated" time 700 end samp.CmdRet :on_new_chatline 0BE5: raknet 23@ = get_hook_param PARAM_PACKETID if 23@ == RPC_ScrClientMessage then 24@ = 1 end 0BE0: raknet hook_ret true
tested with cleo 4.1, samp 0.3.7 and sampfuncs 5.3.1