📜Events

PlayerLoaded

Event Description

This event will trigger when the player loads successfully in your server. This event can be used in your script to trigger an event when the player is loaded in the server.

Event Example

RegisterNetEvent('ug-core:PlayerLoaded', function (player, isNew, skin)
    print('Player Loaded Successfully')
end)

Event Arguments

ArgumentTypeRequiredDescription

player

player

no

Returns the player object.

isNew

boolean

no

Sets a way to say if the player is new or not.

skin

table

no

Simple skin table of the player's skin.


SetMoney

Event Description

This event will get triggered when the player's account is changed. This event can be used in your script to execute a function when the player's account is changed.

Event Example

RegisterNetEvent('ug-core:SetMoney', function (account)
    local nameAccount = account.name
    local amount = account.money
    
    if nameAccount == 'cash' then
        print('My Cash Amount is now $' .. amount)
    end
end)

Event Arguments

ArgumentTypeRequiredDescription

account

table

yes

Returns the accounts of the player.

Account Table Informations

ObjectTypeDescription

name

string

Name of the current account, like as cash, bank or black_money.

label

string

Label of the current account, like as "Cash", "Bank" or "Black Money".

money

number

Gets the amount of money that the player has.


Notify

Event Description

This event can get triggered by a function or an event in your script. To be able to use this, you must have ug-notify installed in your server.

Event Example

local function NotifyPlayer(source, title, description, type, length)
    TriggerEvent('ug-core:Notify', source, title, description, type, length)
end

Event Arguments

ArgumentTypeRequiredDescription

source

number

yes

The player source.

title

string

yes

Title that will show in the notification.

description

string

yes

Message that will show in the notification.

type

string

yes

Type of the notification.

length

number

yes

Duration of the notification in ms.


Last updated