Tynopia
  • Welcome!
  • Reference
    • 🏎️Rocket Soccer
      • Exports (API Communication)
      • Controls
      • Settings
      • Language
      • Fxmanifest
      • Update
    • 🛷Sled Race
      • Exports
      • Functions
      • Events
      • State Bags
    • Support
Powered by GitBook
On this page
  • Functions
  • Events
  1. Reference
  2. Rocket Soccer

Exports (API Communication)

All Functions only accessible at server side

PreviousRocket SoccerNextControls

Last updated 5 months ago

Good to know: You can use all functions as event or manupulation of the logic

Functions

Send a notify

exports["RocketSoccer"]:Notify(source, message)
Name
Type

source

int

message

string

Start a round

exports["RocketSoccer"]:StartRound(sourceOrange, sourceBlue)
Name
Type

sourceOrange

int

sourceBlue

int

If the return of the function is false, the round will not start, but if it is true, it will.

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)
Name
Type

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 "")

Check if player is allowed to join the queue

exports["RocketSoccer"]:IsPlayerAllowed(source)
Name
Type

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] = true

true or false

Add a player to the queue

exports["RocketSoccer"]:AddPlayerToQueue(source, team, force, player)
Name
Type

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 / false

true or false

Check if player is in the queue of a team

exports["RocketSoccer"]:IsPlayerInQueue(source)
Name
Type

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)
Name
Type

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] = nil

Get 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)
Name
Type

model

int / string

vector

Change the following line to return a different variable on return.

This can help if there are problems with an anticheat.

return CreateVehicle(model, vector, true, false)

Spawn a object

exports["RocketSoccer"]:CreateObject(model, vector)
Name
Type

model

int / string

vector

Change the following line to return a different variable on return.

This can help if there are problems with an anticheat.

return CreateObject(model, vector, true, false, false)

Events

OnExploit

Called when trying to tune up your vehicle using the internal trigger and it is not a Rocket Soccer vehicle.

Name
Type

playerPedId

netID

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)

table ()

Note that the correct data type must be returned (see ).

An entity of the type is returned

table ()

Note that the correct data type must be returned (see ).

An entity of the type is returned

int ()

int ()

🏎️
Vehicle
Object
Manipulation
Return
Tab
Return
Tab
vector3
vector3
Ped
Network ID