multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.41k stars 438 forks source link

triggerServerEvent breaks with oop vector #473

Closed ArranTuna closed 6 years ago

ArranTuna commented 6 years ago

Describe the bug When triggerserverevent has oop argument such as Vector or Matrix then triggerServerEvent doesn't run and don't send any error.

To Reproduce Example: pos = localPlayer:getPosition() (Or Vector3(getElementPosition(localPlayer)) triggerServerEvent("Player->Spawn", localPlayer, localPlayer, pos) No error, no run. When i change the pos argument in triggerServerEvent to x,y,z the TriggerServerEvent works.

Example: triggerServerEvent("Player->Spawn", localPlayer, localPlayer, pos.x, pos.y, pos.z)

Executing client-side command: pos = localPlayer:getPosition() Executing client-side command: triggerServerEvent("Player->Spawn", localPlayer, localPlayer, pos) Command results: false [boolean]

Expected behavior For event to actually trigger.

Screenshots unstated

MTA Client (please complete the following information): unstated

MTA Server (please complete the following information): unstated

Additional context

AlexTMjugador: As a workaround, you can use the example in this Wiki page to transfer vectors safely in triggerServer/ClientEvent: https://wiki.multitheftauto.com/wiki/GetUserdataType#Example

https://bugs.mtasa.com/view.php?id=9791

misterquestions commented 6 years ago

“Elements of the Vector or Matrix classes cannot be passed!”, read it on the wiki please.

CrosRoad95 commented 6 years ago

i have idea how this could be resolved. custom classes could contain special method that pack every data, send, then unpack by other method ( triggers automaticly will detect this method, call them and unpack in other side )

qaisjp commented 6 years ago

Duplicate of #374