Kruggar Posted July 30, 2019 Share Posted July 30, 2019 Hey, I'm a fresh newbie at coding and I've been trying to code a cleo mod for GTA SA:MP which reads the chat and automatically triggers a command after a specified text in chat. For example, i want to create a mod in which, whenever it says in chat "{FFAB00} ** {FFEB00}Your friend (playername) is now online.{FFAB00} **.", it automatically sends a command "/contract (id of player) 10000". I tried coding it several times, but failed to get ID of player. I don't know if the code is correct, so i'll just put it here for a review. {$CLEO .cs} 0000: repeat wait 1337 until Samp.Available() thread 'MESSAGES' REPEAT wait 0 UNTIL 0AFA: SAMP_IS_READY while true wait 0 0AC8: 1@ = allocate_memory_size 145 0AC8: 11@ = allocate_memory_size 145 0AC8: 28@ = allocate_memory_size 145 0AB1: call @getChatEntryText 1 id 99 to 1@ if 0C18: 2@ = strstr string1 1@ string2 "{FFAB00} ** {FFEB00}Your friend %d is now online.{FFAB00} **." then wait 2000 0AF9: samp say_msg "/contract %d 10000" end end :GETCHATENTRYTEXT IF 0AA2: 1@ = "samp.dll" THEN 1@ += 0x21A0E4 0A8D: 1@ readMem 1@ sz 4 vp 0 1@ += 0x132 0@ *= 0xFC 005A: 1@ += 0@ 1@ += 0x20 0AA3: 1@ END 0AB2: ret 1 1@ PS: Can anybody help me with this? Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now