local phoneIsUseNow = exports["sfphone"]:phoneIsUseNow()print(phoneIsUseNow) -- return true or false
local mycgroup = exports["sfphone"]:cgroupPlayer()if mycgroup >0thenprint("Your id group is "..mycgroup)elseprint("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.gexports["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 falseexports["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 notifylocal message ="Hello World" -- some textlocal fromNumber =1-- example for ALERT in config.js local imgURL =nil-- some url for image, only formats .jpg .jpeg .png or set nilexports["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 notifylocal sourceIdPlayer =1-- enter player ID serverexports["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 worklocal message ="Hello World" -- some textlocal 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 textlocal 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 = sourceexports["sfphone"]:getNumberFromSource(src)
Custom notification for player
local src = sourcelocal time =10-- in seconds (notification display time)local text ="Hello World" -- some textexports["sfphone"]:customNotification(src, time, text)