View Issue Details

IDProjectCategoryView StatusLast Update
0009791Multi Theft Auto : San Andreaspublic2018-09-16 17:32
ReporterJokersajtAssigned To 
PrioritylowSeverityminorReproducibilityalways
Status closedResolutionduplicate 
PlatformWindowsOS10 x64OS Version?
Product Version 
Target VersionFixed in Version 
Summary0009791: triggerServerEvent breaks with oop vector
Description

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

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)

TagsNo tags attached.

Relationships

duplicate of 0008591 closed Vectors and matrices cannot be passed via events 

Activities

Bonus1702

2017-12-26 00:13

reporter   ~~0026369

"You can pass any lua data type (except functions). You can also pass elements."
I think "pos" is neither a lua data type nor an element.

Well, should still output an error or a warning.

thisdp

2018-01-01 09:43

viewer   ~~0026374

triggerServerEvent doesn't work well with vector

arranTuna

2018-01-03 17:22

manager   ~~0026383

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

AlexTMjugador

2018-01-11 17:00

viewer   ~~0026391

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

Inspirator

2018-01-12 08:51

viewer   ~~0026392

Same for any object. I really hope they will add support for it.

Pirulax

2018-07-04 20:21

reporter   ~~0026614

Vectors work like this:
They are stored on the side where they got created in the memory.
They have their values(fX, fY, whatever)
This is why you cant pass(and because they aren't synced with the server, so they dont have a representation on the server/client-side)
So yeah, this would be a great thing to be fixed.

Issue History

Date Modified Username Field Change