I tried with this code exactly as I have seen with others for reading a text from the chat on SA-MP type cleo (sanny builder), but it doesn't work, I don't know why. What is wrong here?
You are allocating every time you read the chat, but only free the memory when the condition is true. Don't know if samp crashes, but if it does it's probably because of this.
Get the Right Chat Message: First, grab the chat messages with color codes. You can find them in your SA-MP chatlog in the "GTA SA User Files" folder.
Search for Key Phrases: Use the “search string in string” thing to hunt down just the important stuff, like "turn on the engine." Don’t go overboard.
Wrap it in a while true Loop: Put your script inside a while true loop so it runs forever like a tired cat that refuses to nap.
Don’t Overdo Memory Allocation: Allocate memory once at the start, then forget about it. No need to keep freeing it over and over—it’s not a revolving door.
Give It a Break: After running the /engine command, add a little delay. Otherwise, it'll spam /engine like it’s the only thing it knows.
Use 0@ - 31@ Instead of $variable: Don’t use $variable. Stick with 0@ - 31@—trust me, it’s cooler and works better.
Thanks for the help, but I already discovered the cause of this problem of the code not working, it was simply from "chat modern.asi", which I don't understand why it doesn't work together with it...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.