Jump to content

Recommended Posts

Posted

Issue: SlotID does not allow us to get a Unit Object back due to a lack of any function I know of existing for it. Previously, this was not a huge issue because the user could create a hashmap of all known client or player skill aircraft - however with dynamic slots now, this is not possible to pre-bake a hashmap on mission start, and must be done every single time to get the single dynamicspawn that just appeared.. This is very bad performance (and just bad code in general), but not doing so results in being unable to slotblock for individual users if dynamic spawns are enabled on a server.

Reason its useful: one valid reason for wanting to slot-block specific users for a dynamic spawn would be a lives system and running out of lives for the playername in question but airframes still existing for other players.



Solution: Hooks for onPlayerChangeSlot and onPlayerTryChangeSlot should return a unit object in addition to slotid (as not to break any existing code, retaining backwards compatibility for normal slot actions)


Current possible workarounds:
1: using event birth - Issue would be crashing a players client by unloading them during their load in. Very bad for stability.
2: using event enginestart/takeoff - Issue is wasting players time starting before being kicked back to slot menu due to not meeting requirements.
3: disable dynamic slots for any aircraft you would ever slotblock for (most). - issue is dynamic spawns cant be leveraged then.
4: regernerate a hashmap of unit objects and unitID's every time a player tries to slot in to get the object to run our code. - issue is bad performance, and unclear if this would even work with dynamic slots as its unlcear if the object even exists yet at the time of hook tryChangeSlot.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...