---
description: All Export and events off base.
---

# MP-Base

#### Server Side

exports:&#x20;

{% code overflow="wrap" fullWidth="false" %}
```lua
GetObject()
Returns MP

changeMoney(source, bankingType, amount, changer)
changes money of player, source, type="cash/bank", amount, changer="add/del"
```
{% endcode %}

Events / Functions

```lua
MP.Functions.RegisterServerCallback(name,cb)
Registers callback

MP.Functions.TriggerServerCallbackname, requestId, source, cb, ...)
Triggers callback

MP.Functions.GetPlayer(source)
Grabs player allows you to use Player.Functions

MP.Functions.GetPlayerData()
Gets Client Side Player Data

MP.Functions.DeleteObject(object)
deletes passed object

MP.Functions.TriggerServerCallback(name, cb, ...)
Triggers a server callback

MP.Functions.GetPlayers()
Gets players client side

MP.Functions.GetClosestPlayer(coords)
Gets the closest player from you.

MP.Functions.RegisterServerCallback(name, cb)
Registers a server callback.

MP.Functions.TriggerServerCallback(name, requestId, source, cb, ...)
Triggers the callback.

MP.Functions.GetPlayer(source)
Gets Data of player.

MP.Functions.AdminPlayer(source)
Gets Data of admin player.

MP.Functions.CreatePlayer(source, Data)
Takes data from the ui and adds character to database.

MP.Functions.LoadPlayer(source, pData, cid, new)
Takes data in and begins to load the player and checks if it's a new player.

MP.Functions.setGroup(player, group)
Sets group if the player is an admin on load and ranking sql table.
```

***

#### Client Side

exports:&#x20;

```
AdminSaveCoords()
Saves coords to a file, for admins/devs to use to grab new locations.

MPSpawnVehicle(vehicle)
spawns vehice in front of the player. You need to pass a vehicle through.

MPTeleportWaypoint(source)
passing source through, if you have a waypoint on the map it will teleport you there.

verifyName(name)
Ensures that all names are checked with the banned name list.

ChangeChar()
Opens character changing menu.

GetObject()
Returns MP to use all functions.

updateGroup(group)
Updates players group, needs a group passed through.

DeleteVehicle(vehicle)
Deletes vehicle that was passed through

GetVehicleInDirection()
returns vehicle your player is looking at.

Draw3dText(x,y,z, text)
draws text on coords.
```

Events / Functions:&#x20;

```lua
MP.Functions.GetKey(key)
Returns key number to key.

MP.Functions.DeleteObject(object)
Deletes object that was sent through.

MP.Functions.TriggerServerCallback(name, cb, ...)
Triggers a server callback

MP.Functions.GetPlayers()
Gets all players.

MP.Functions.GetClosestPlayer(coords)
Gets closest player near you.

MP-Admin:bringPlayer(source,target)
Grabs source to bring target to you. Target is an Id number.

MP-Base:Char:Selecting()
Selecting character is set to true.

MP-Base:Char:setupCharacter()
Grabs your characters and opens ui to select.

MP-Base:PlayerLoaded(new)
Checks if player is new on load, if new then sent to airport and opens clothing menu.

MP:Client:OnPlayerUnload()
Unloads the player.

MP-Base:Char:StartCamera()
Starts camera for when joining.

MP:Player:UpdatePlayerData()
Updates players playerdata.
```

***

#### Player

```lua
self.Functions.Save()
Saves Player

self.Functions.UpdatePlayerData()
Updates playerdata

self.Functions.UpdateMoney(bankingType, amount, change)
changes money of player, type="cash/bank", amount, changer="add/del"
```
