Exports

Lua code examples for Client Side

local phoneIsUseNow = exports["sfphone"]:phoneIsUseNow()
print(phoneIsUseNow) -- return true or false
local mycgroup = exports["sfphone"]:cgroupPlayer()
if mycgroup > 0 then
    print("Your id group is "..mycgroup)
else
    print("You havent a group")
end

Use if the phone stops working

TriggerEvent("nuifix") -- if the NUI breaks.

Lua code examples for Server Side

local src = source 
exports["sfphone"]:createCgroup(src) -- creates a group in cGroups app
local id_group = 5 -- for e.g
exports["sfphone"]:removeCgroup(id_group) -- remove a group in cGroups app

If you want to block the SIM card and make a duplicate

local src = source 
exports["sfphone"]:openMenuResetSim(src)

If you want to install apps on your phone with an external script

local src = source 
local applicationName = "cgroups" -- support "aparat", "gallery", "bank", "appstore",
-- "news", "notes", "advertising", "twitter", "walletc", "cgroups", "racing"
local applicationPrice = 1000 -- 1000($), you can change to other number, 0 or false
exports["sfphone"]:installApp(src, applicationName, applicationPrice)

Example of sending SMS for players from other your scripts

local toNumberPhone = 12345 -- if the phone number is incorrect, you will receive a notify
local message = "Hello World" -- some text
local fromNumber = 1 -- example for ALERT in config.js 
local imgURL = nil -- some url for image, only formats .jpg .jpeg .png or set nil
exports["sfphone"]:sendNewMessageFromScript(toNumberPhone, message, fromNumber, imgURL)

As an administrator, you can create a sim card with any number you want

If you do not have permission this function will not work

local src = source 
local numberPhone = 123 -- if the phone number is unavailable, you will receive a notify
local sourceIdPlayer = 1 -- enter player ID server
exports["sfphone"]:createSimByAdmin(src, numberPhone, sourceIdPlayer)

Example of sending SMS for group players from application cGroups

local fromNumber = 1 -- example for ALERT in config.js 
local idGroup = 5-- if you set 0 it will not work
local message = "Hello World" -- some text
local imgURL = "https://media.discordapp.net/attachments/947451128767987712/1010941186275545138/screenshot.jpg" -- some url for image, only formats .jpg .jpeg .png or set nil
exports["sfphone"]:sendNewMessageTocGroup(fromNumber, idGroup, message, imgURL)

Example of sending SMS for online players

local fromNumber = 1 -- example for ALERT in config.js 
local message = "Hello World" -- some text
local imgURL = "https://media.discordapp.net/attachments/947451128767987712/1010941186275545138/screenshot.jpg" -- some url for image, only formats .jpg .jpeg .png or set nil
exports["sfphone"]:sendNewMessageToOnline(fromNumber, message, imgURL)

Example of retrieving a player's current phone number

local src = source
exports["sfphone"]:getNumberFromSource(src)

Custom notification for player

local src = source
local time = 10 -- in seconds (notification display time)
local text = "Hello World" -- some text
exports["sfphone"]:customNotification(src, time, text)

Last updated