-
Notifications
You must be signed in to change notification settings - Fork 16
Event functions #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Event functions #51
Conversation
| - name: sendTo | ||
| type: 'table/element' | ||
| description: The event will be sent to all [players](/reference/player "Player") that are children of the specified element. By default this is the [root](/reference/root "Root") element, and hence the event is sent to all players. If you specify a single player it will just be sent to that player. This argument can also be a table of player elements. | ||
| default: getRootElement( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
| description: MISSING_PARAM_DESC | ||
| - name: sendTo | ||
| type: 'table/element' | ||
| description: The event will be sent to all [players](/reference/player "Player") that are children of the specified element. By default this is the [root](/reference/root "Root") element, and hence the event is sent to all players. If you specify a single player it will just be sent to that player. This argument can also be a table of player elements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can write function or element names in the old wiki style, so instead of [addEventHandler](/reference/addEventHandler) or [player](/reference/player) you can simply use [[addEventHandler]] or [[player]].
| @@ -1,15 +1,15 @@ | |||
| # Scraped from: https://wiki.multitheftauto.com/wiki/TriggerLatentServerEvent | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove those comments as well.
| addEventHandler ( "onSpecialEvent", root, specialEventHandler ) | ||
|
|
||
| -- You can then trigger this event later on using: | ||
| triggerEvent ( "onSpecialEvent", root, "test" ) | ||
| -- This will cause the handler to be triggered, so "test" will be output to the chatbox. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use code formatting, even if the examples are copied from the wiki. All functions edited so far have nicely formatted code without extra spacing, unnecessary blank lines, etc. In Visual Studio Code, it’s simply Ctrl + Shift + F.
| values: | ||
| - type: bool | ||
| name: value | ||
| description: Always returns true . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t want to be an orthography nitpicker, but please pay attention to errors in the text, typos, or things like this (a space before a period). Unfortunately, the scraping process made a real mess of the texts and descriptions. Sometimes the descriptions are even incorrect. Try to fix all of that. We want the new wiki to be BETTER than the old one - clear and reliable. Always make sure the current description matches the source code, and whenever possible, try to emphasize key words using backticks or bold formatting. Unfortunately, simply copying content from the old wiki into the new one is not a sufficient process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, always bold what the function returns - whether it’s true, false, or nil
|
It’s great that you want to help develop the wiki! But you need to know that the old, original wiki isn’t perfect - very often it’s incomplete and contains incorrect or outdated information. That’s why please always verify the description and syntax against the source code. While creating many functions, I very often came across outdated descriptions, incorrect examples (for example with typos), missing OOP documentation even though the function supports OOP, and a lot of mess left after the scraping process. So this is my personal request: verify and edit the content, don’t trust the original wiki blindly, and don’t just copy information from it. |
|
Thanks for your review! I was just copying from original wiki to here I didn' know the original has many mistakes btw I'll fix them |
This PR's missing
/reference/Event_Source_Elementbecause I don't have any idea how to make it.