6,833
edits
No edit summary |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 22: | Line 22: | ||
* {{Side|shared=1}} <code>Event</code> - event | * {{Side|shared=1}} <code>Event</code> - event | ||
** {{Side|shared=1}} <code>CancellableEvent</code> - cancellable event | ** {{Side|shared=1}} <code>CancellableEvent</code> - cancellable event | ||
** {{Side|shared=1}} <code>KeyEvent</code> - key | ** {{Side|shared=1}} <code>KeyEvent</code> - key event | ||
* {{Side|client=1}} <code>Font</code> - font | * {{Side|client=1}} <code>Font</code> - font | ||
* {{Side|client=1}} <code>GUIElement</code> - gui element | * {{Side|client=1}} <code>GUIElement</code> - gui element | ||
Line 111: | Line 111: | ||
|Player (Local) | |Player (Local) | ||
|Client-Side | |Client-Side | ||
|When the client's player-ped has spawned. [[OnPedSpawn|OnPedSpawn]]. | |When the local client's player-ped has spawned. [[OnPedSpawn|OnPedSpawn]]. | ||
|When the client's player-ped has de-spawned. [[OnPedWasted|OnPedWasted]]. | |When the local client's player-ped has de-spawned. [[OnPedWasted|OnPedWasted]]. | ||
|- | |- | ||
|Player (Remote) | |Player (Remote) | ||
Line 118: | Line 118: | ||
|When any of these qualifying conditions occur:<br> | |When any of these qualifying conditions occur:<br> | ||
* The remote client's player-ped has spawned, assuming the local client's player-ped is spawned.<br> | * The remote client's player-ped has spawned, assuming the local client's player-ped is spawned.<br> | ||
* The remote client's player-ped has streamed back into streaming range of the<br>local client's player-ped 3D position, assuming both the local client's player-ped is spawned and<br>depending on <code>NetFlags</code> values | * The remote client's player-ped has streamed back into streaming range of the<br>local client's player-ped 3D position, assuming both the local client's player-ped is spawned and<br>depending on qualifying <code>NetFlags</code> values for all applicable elements.<br> | ||
* The local client's player-ped has spawned.<br> | * The local client's player-ped has spawned.<br> | ||
[[OnPedSpawn|OnPedSpawn]] [[OnElementStreamIn|OnElementStreamIn]]. | [[OnPedSpawn|OnPedSpawn]] [[OnElementStreamIn|OnElementStreamIn]]. | ||
|When any of these qualifying conditions occur:<br> | |When any of these qualifying conditions occur:<br> | ||
* The remote client's player-ped has de-spawned, assuming the local client's player-ped is spawned.<br> | * The remote client's player-ped has de-spawned, assuming the local client's player-ped is spawned.<br> | ||
* The remote client's player-ped has streamed out of streaming range of the<br>local client's player-ped 3D position, assuming both the local client's player-ped is spawned and<br>depending on <code>NetFlags</code> values | * The remote client's player-ped has streamed out of streaming range of the<br>local client's player-ped 3D position, assuming both the local client's player-ped is spawned and<br>depending on qualifying <code>NetFlags</code> values for all applicable elements.<br> | ||
* The local client's player-ped has de-spawned.<br> | * The local client's player-ped has de-spawned.<br> | ||
[[OnPedWasted|OnPedWasted]] [[OnElementStreamOut|OnElementStreamOut]]. | [[OnPedWasted|OnPedWasted]] [[OnElementStreamOut|OnElementStreamOut]]. | ||
Line 131: | Line 131: | ||
As a result, this can give the illusion that some functions are broken when they aren't, such as the result of [[getElementsByType|getElementsByType]] including more than one array entry for the "same element", which are unequal in scripting comparison operators, after internal re-construction, eg. when a client-side player streams out of distance radius of the local player and then streams back in.<br> | As a result, this can give the illusion that some functions are broken when they aren't, such as the result of [[getElementsByType|getElementsByType]] including more than one array entry for the "same element", which are unequal in scripting comparison operators, after internal re-construction, eg. when a client-side player streams out of distance radius of the local player and then streams back in.<br> | ||
To properly de-reference a handle when it's no longer needed, be sure to use <code>delete myVariable;</code> or <code>myVariable = null;</code> in JS, or <code>myVariable = nil</code> in Lua, where applicable.<br> | To properly de-reference a handle when it's no longer needed, be sure to use <code>delete myVariable;</code> or <code>myVariable = null;</code> in JS, or <code>myVariable = nil</code> in Lua, where applicable.<br> | ||
Continuous attempts of internal destruction of a handle occurs when the qualifying internal destruction reason has occurred, until there are no references remaining in scripting for the handle, rather than only one internal destruction attempt. | Continuous attempts of internal destruction of a handle occurs when the qualifying internal destruction reason has occurred, until there are no references remaining in scripting for the handle, rather than only one internal destruction attempt.<br> | ||
A handle becomes invalidated when a handle destruction attempt has first occurred.<br> | |||
Attempting to hold onto a reference of invalidated handles could cause memory exhaustion, and usage of an invalid handle with the scripting API should give a scripting error.<br><br> | |||
Also, when the local client's player-ped is not spawned, applicable handles will not be usable in client-side scripting.<br> | |||
For example, remote clients' player-ped handles are internally attempted to be destructed when the local client's player-ped de-spawns, until the local client's player-ped re-spawns.<br> | |||
==Previous Versions== | ==Previous Versions== |
edits