addChatMessageEx(Color, wText) {
wText := "" wText
if(!checkHandles())
return false
VarSetCapacity(data2, 4, 0)
NumPut(Color,data2,0,"Int")
Addrr := readDWORD(hGTA, dwSAMP+ADDR_SAMP_CHATMSG_PTR)
VarSetCapacity(data1, 4, 0)
NumPut(readDWORD(hGTA, Addrr + 0x12A), data1,0,"Int")
WriteRaw(hGTA, Addrr + 0x12A, &data2, 4)
dwFunc := dwSAMP + FUNC_SAMP_ADDTOCHATWND
dwChatInfo := readDWORD(hGTA, dwSAMP + ADDR_SAMP_CHATMSG_PTR)
if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY
return false
}
callWithParams(hGTA, dwFunc, [["p", dwChatInfo], ["s", wText]], true)
WriteRaw(hGTA, Addrr + 0x12A, &data1, 4)
ErrorLevel := ERROR_OK
return true
}