GetPlayerName(<PlayersServerID>) -- Returns the players discord name as a string
GetPlayerDiscordID(<PlayersServerID>) -- Returns the players discord id as a string
GetPlayerHWID(<PlayersServerID>) -- Returns the players hardware id as a string. This is a generated string by us.
GetPlayerVehicles(<PlayersServerID>) -- Returns the players vehicles as a object/array
DropPlayer(<PlayersServerID>, <Reason>) -- Drops the connection for a specific player. Essentially Kicking them
SendChatMessage(<Message>) -- Sends a message over the network as the server.
CancelEvent() -- Cancels the event from happening
"onPlayerJoin" -- Returns the players ID -- A player has joined and loaded in
"onPlayerConnecting" -- Returns the players ID -- A player is loading in (Before loading the map)
"onPlayerJoining" -- Returns the players ID -- A player is loading the map and will be joined soon
"onChatMessage" -- Returns the players ID that sent it + the senders name + the chat message -- A chat message was sent. This would be good for making a commands system
"onVehicleSpawn" -- Returns the players ID, the vehicle ID and the vehicle data -- This is called when someone spawns a vehicle.
RegisterEvent(<EventName>,<functionName>) -- will register that function to the event specified both must be a string
TriggerLocalEvent(<EventName>) -- will call every registered function in the same plugin folder
TriggerGlobalEvent(<EventName>) -- will call every registered function in any plugin folder
function onInit() -- if declared in a lua file it will be called once C++ successfully finished loading the current lua file
CreateThread(<functionName>) -- will execute the function on a dedicated thread
GetPlayerCount() -- will return how many players are connected
Sleep(<millisecs>) -- will pause execution for the amount of time specified (warning doing so will pause the entire server if you didn't create a thread)
GetPlayers() -- will return a table of IDs with Names
example :
if GetPlayers() ~= nil then
for ID,Name in pairs(GetPlayers()) do
print(ID)
print(Name)
end
end