View Issue Details

IDProjectCategoryView StatusLast Update
0009856New issuesScriptingpublic2018-07-06 14:37
ReporterGrafuAssigned Toqaisjp 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Summary0009856: getElementColShape does not work
Description

getElementColShape always returns false for player no matter he is outside any colshape or inside a colshape

Steps To Reproduce
  1. Go inside any colshape.
  2. crun getElementColShape(localPlayer) --returns false
  3. srun getElementsColShape(getRandomPlayer()) --returns false
TagsNo tags attached.

Activities

MrTasty

2018-05-16 10:04

viewer   ~~0026527

Wiki example seems to suggest this function is for getting the col shape of a marker rather than of a player.
https://wiki.multitheftauto.com/wiki/GetElementColShape

The source only works for CClientMarker and CClientPickup
https://github.com/multitheftauto/mtasa-blue/blob/7cf9dc48ddf1a10ecc782b052726a326a9ca7dab/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp#L6747-L6762

Perhaps the function should output a debug message if the input element type is not supported.

NanoBob

2018-05-16 10:08

viewer   ~~0026528

The getElementColShape function is not used to get what colshape a user is in, but get the colshape belonging to an element. Which is why it only works for pickups and markers, since these elements have colshapes of their own.

So this is the intended behaviour of this function. What you're looking to achieve can be done using the onColShapeHit and onColShapeLeave events.
https://wiki.multitheftauto.com/wiki/OnColShapeHit
https://wiki.multitheftauto.com/wiki/OnColShapeLeave

qaisjp

2018-07-06 14:37

administrator   ~~0026635

I've tweaked the documentation. Thanks guys.

Issue History

Date Modified Username Field Change