Exports (API Communication)
All Functions only accessible at server side
Functions
Send a notify
exports["RocketSoccer"]:Notify(source, message)source
int
message
string
Start a round
exports["RocketSoccer"]:StartRound(sourceOrange, sourceBlue)sourceOrange
int
sourceBlue
int
Stop a round
exports["RocketSoccer"]:StopRound()If the return of the function is false, the round will not stop, but if it is true, it will.
Get a player name
exports["RocketSoccer"]:GetPlayerName(source)source
int
Change the return of the function to a different name (this will be displayed in the DUI)
The respective player name (Changeable by "Manipulation")
Check if player is allowed to join the queue
exports["RocketSoccer"]:IsPlayerAllowed(source)source
int
If true is returned, the player can be added to the respective queue.
Note that you have to add the player to the queue yourself:
queue[team][source] = truetrue or false
Add a player to the queue
exports["RocketSoccer"]:AddPlayerToQueue(source, team, force, player)source
int
team
string (blue or orange)
force
boolean
player
int (discord user id)
The return is only relevant for further processing of the function.
The actual logic is:
queue[team][source] = true / falsetrue or false
Check if player is in the queue of a team
exports["RocketSoccer"]:IsPlayerInQueue(source)source
int
Change the return of the function to change the logic:
true / false
true or false
Remove a player from the queue
exports["RocketSoccer"]:RemovePlayerFromQueue(source, player)source
int
player
int (discord user id)
The following line is the deciding logic which a player removes.
Modify these lines to detect manipulation
queue.blue[source] = nil
queue.orange[source] = nilGet the current round
exports["RocketSoccer"]:GetCurrentRound()If no round is started, the return value is nil
Otherwise the round model is returned
{
type = 0, -- 0 = Starting - 1 = In Game
time = Settings.Round.Wait,
url = Settings.Logo,
ball = object,
players = {
orange = {
source = playerOrange,
ped = GetPlayerPed(playerOrange),
vehicle = carOrange,
name = Settings.API.GetPlayerName(playerOrange),
score = 0
},
blue = {
source = playerBlue,
ped = GetPlayerPed(playerBlue),
vehicle = carBlue,
name = Settings.API.GetPlayerName(playerBlue),
score = 0
}
}
}Spawn a vehicle
exports["RocketSoccer"]:CreateVehicle(model, vector)model
int / string
vector
table (vector3)
An entity of the type Vehicle is returned
Spawn a object
exports["RocketSoccer"]:CreateObject(model, vector)model
int / string
vector
table (vector3)
An entity of the type Object is returned
Events
OnExploit
Called when trying to tune up your vehicle using the internal trigger and it is not a Rocket Soccer vehicle.
playerPedId
int (Ped)
netID
int (Network ID)
OnWinning
Called when the round ends.
Reasons:
Time expired
A team leaves the server
team
string (blue or orange)
OnGoal
Called when a team scores a goal
team
string (blue or orange)
Last updated