hardkor
Active member
- Joined
- Jun 16, 2019
- Messages
- 28
- Reaction score
- 0
I want to create if a player is in a vehicle do a chat command. In this case, I need every time the player enters a vehicle after like a 3-sec chat command /upgrade gets sent.
I found a code in this thread http://ugbase.eu/index.php?threads/snippet-write-in-chat-without-sfuncs-0af8-0af9.3814/
I tried making it by myself but I don't know Cleo. And it's for 0.3DL.
I found a code in this thread http://ugbase.eu/index.php?threads/snippet-write-in-chat-without-sfuncs-0af8-0af9.3814/
I tried making it by myself but I don't know Cleo. And it's for 0.3DL.
Code:
{$CLEO .cs}
0000:
wait 10000 /// wait 10sec until samp is redy
const
SAMP_CHAT_INFO_OFFSET_03DL = 0x2ACA10
FUNC_ADDTOCHATWND_03DL = 0x67650
FUNC_SAY_03DL = 0x5860
FUNC_SEND_CMD_03DL = 0x69340
end
0AC8: 0@ = allocate_memory_size 260
0AD3: 0@ = format "/upgrade"
WHILE TRUE
WAIT 0
wait 1500
0AB1: @SEND_CMD 1 text 0@
END
:SAY
//0AB1: @SAY 1 $text
IF 0AA2: 1@ = "samp.dll"
THEN
1@ += FUNC_SAY_03DL
0AA5: call 1@ num_param 1 pop 0 0@
END
0AB2: 0
:Chatmsg
//0AB1: @Chatmsg 2 $color $text
IF 0AA2: 2@ = "samp.dll"
THEN
0085: 3@ = 2@
3@ += SAMP_CHAT_INFO_OFFSET_03DL
0A8D: 3@ = readMem 3@ sz 4 vp 1
0085: 4@ = 2@
4@ += FUNC_ADDTOCHATWND_03DL
0AA6: call 4@ struct 3@ num_params 5 pop 0 params 0 0@ 0 1@ 8
END
0AB2: 0
:SEND_CMD
//0AB1: @SEND_CMD 1 $text
IF 0AA2: 1@ = "samp.dll"
THEN
1@ += FUNC_SEND_CMD_03DL
0AA5: call 1@ num_param 1 pop 0 0@
END
0AB2: 0