# getLatentEventStatus (Server)

> Tells how a latent event the server is sending to a player is going.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Server
- **Category**: Events
- **URL**: https://wiki.mymp.gg/en/getLatentEventStatus-server
- **Counterpart**: Also exists on the client, with its own implementation: [getLatentEventStatus (Client)](https://wiki.mymp.gg/en/getLatentEventStatus-client.md)

## Syntax

```lua
table|false getLatentEventStatus(player thePlayer, int handle)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `thePlayer` | `player` | The player receiving the event. |
| `handle` | `int` | A handle from `getLatentEventHandles` for that player. |

## Returns

A table with `tickStart` and `tickEnd` (on the `getTickCount` scale; `tickEnd` is an estimate while sending and the real end afterwards), `totalSize` (bytes) and `percentComplete` (0 to 100). `false` if the handle does not exist or the transfer finished more than a second ago.

## Example

```lua
addCommandHandler("download", function(player)
    for _, handle in ipairs(getLatentEventHandles(player)) do
        local status = getLatentEventStatus(player, handle)
        if status then
            outputDebugString(getPlayerName(player) .. ": " .. status.percentComplete .. "%")
        end
    end
end)
```

## See also

- [getLatentEventHandles (Server)](https://wiki.mymp.gg/en/getLatentEventHandles-server.md): Lists the latent events the server is still sending to a player.
- [cancelLatentEvent (Server)](https://wiki.mymp.gg/en/cancelLatentEvent-server.md): Stops a latent event the server is sending to a player. The client drops what it had received and the event is not triggered there.
- [triggerLatentClientEvent (Server)](https://wiki.mymp.gg/en/triggerLatentClientEvent.md): Sends an event to the players' clients bit by bit, in the background, at no more than bandwidth bytes a second per player. Meant for large data that must not hold up the rest of the traffic.
