altmp / altv-issues

Issues and roadmap for alt:V project
93 stars 16 forks source link

alt.Object scale setter #1746

Open CsokiHUN opened 1 year ago

CsokiHUN commented 1 year ago

Description of the problem

There is currently no option to modify the object scale

Desired solution for the problem

I think alt.Object could be extended with a .scale property or a .setScale method

Alternatives you considered

No response

Additional context

No response

Version

No response

FabianTerhorst commented 1 year ago

We already have a position and rotation setter serverside.

CsokiHUN commented 1 year ago

We already have a position and rotation setter serverside.

I know, but entities don't have a scale, and that's why I wanted it. This is how you can scale in FiveM, but a separate scale property might be a better solution

FabianTerhorst commented 1 year ago

I don't think players and vehicles would get a synchronized scale property.

CsokiHUN commented 1 year ago

Actually, this is only useful for objects

FabianTerhorst commented 1 year ago

Then i will reopen it but you need to rename the issue and description and replace entity with alt.object.

LeonMrBonnie commented 1 year ago

Could you maybe give an example how you would do it in FiveM?

CsokiHUN commented 1 year ago

Could you maybe give an example how you would do it in FiveM?

https://docs.fivem.net/natives/?_0xFB0639B

The FxDK map editor sets the scale of the object with this. But of course it can also be used in scripts

LeonMrBonnie commented 1 year ago

Could you maybe give an example how you would do it in FiveM?

https://docs.fivem.net/natives/?_0xFB0639B

The FxDK map editor sets the scale of the object with this. But of course it can also be used in scripts

Unfortunately that doesn't really help me, I don't know how you would set the scale via the matrix, so some code example would be very helpful in implementing this.

CsokiHUN commented 1 year ago

I tried to make a little help, I hope it worked. Images: https://imgur.com/a/5JBIpZE Map loader script (generated by FxDK): https://gist.github.com/CsokiHUN/ff1643ca979a2c0cc104d753ca4809ce

And I found a similar one on stackoverflow. (link)