Skip to content

Commit

Permalink
Update SAMP_REGISTER_CLIENT_SIDED_COMMAND.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Aldrin-John-Olaer-Manalansan authored Mar 5, 2025
1 parent f19283a commit 42c1222
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sa/docs/SAMP_REGISTER_CLIENT_SIDED_COMMAND.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
* When a callback is hooked on a chatcommand, then everytime we type this chatcommand, it will not be sent to the server. To reverse this behavior, call Opcode 0B63 for the affected chatcommand.
* When a callback is hooked on a chatcommand, then everytime we type this chatcommand, it will not be sent to the server. To reverse this behavior, execute SAMP_UNREGISTER_CLIENT_SIDED_COMMAND for the affected chatcommand.
* The chat command trigger text will be **/\<chatcommand\>** . For example:
* if chatcommand = **"killme"** then you need to type **/killme** in chat
* if chatcommand = **"/killme"** then you need to type **//killme** in chat
* You must pass an offset label to callbacklabel. Like For example, **@ChatCallback_KillMe**
* Construct the callback's flow of execution with caution.
* Remember that callbacks have higher priority than the custom script's main thread. Meaning, eveytime the script encounters the **WAIT(Opcode 0001)** command at the main thread, the script will execute all callbacks first(if interrupt flag was fired by a callback), then continues to execute the main thread's commands after where the **WAIT** command was encountered.
* Remember that callbacks have higher priority than the custom script's main thread. Meaning, eveytime the script encounters the WAIT command at the main thread, the script will execute all callbacks first(if interrupt flag was fired by a callback), then continues to execute the main thread's commands after where the command WAIT was encountered.
* Avoid executing too much commands inside the callback. Doing so would lead to undersirable script behavior, like failing to detect interrupts from other registered callbacks.
* **WAIT(Opcode 0001)** command inside a Callback **WILL NOT WORK!** Because callbacks are designed to finish as soon as possible.
* Take note that all callbacks created by this command must use **SAMP_CMD_RET(Opcode 0B43)** command as returning statement, indicating the end of callback.
* **WAIT** command inside a Callback **WILL NOT WORK!** Because callbacks are designed to finish as soon as possible.
* Take note that all callbacks created by this command must use **SAMP_CMD_RET** command as returning statement, indicating the end of callback.

0 comments on commit 42c1222

Please sign in to comment.