Envi Scripts Documentation
  • 👋Introduction
  • 🌉Envi-Bridge
  • ⚙️Compatibility
  • 🖨️Licensing
  • 📒Premium Scripts
    • ❔FAQ / COMMON ISSUES
    • ‼️FIRST STEPS (READ FIRST)
    • ⭐Useful Resources
    • 👀Envi FiveM Showcase Server
    • 💊Envi-Addictions
      • ❗First Time Setup
      • Inventory Setup
      • Exports and Commands
      • Config File
    • 📸Envi-Camera
      • ❗First Steps
      • Inventory Setup
      • Editable Functionality
      • Complete Lens Kit
      • Printing Photos
      • Ped Reactions
      • Exports
      • Config File
    • 🪚Envi-ChopShop
      • Inventory Setup
      • How to Chop
      • Props for AntiCheats
      • Editable Functionality
      • Config File
    • 🪣Envi-Dumpsters
      • Common Issues
      • Inventory Setup
      • Editable Functionality
      • Exports
      • Exclusive Zones
      • Survival Items
      • Shopping Carts
      • Hobo Bowling
      • Hobo Taxi
      • Rats and Racoons
      • Config File
      • V2 Config
    • 💺Envi-Ejector-Seats
      • Inventory Setup
      • How to Eject
      • Editable Functionality
      • Config File
    • 🔥Envi-Flamethrower (Standalone)
      • Common Issues
      • Inventory Setup
      • Refueling
      • Editable Functionality
      • Config File
    • 🪽Envi-Flight-Suits
      • Inventory Setup
      • Flight Suits
      • Config File
    • 🍜Envi-Food-Truck
      • ❗VooDoo Required
      • Common Issues
      • Inventory Setup
      • Adding Additional Grill Items
      • Unique Shops with Liveries
      • Spawning the Trucks
      • Using the Trucks
      • Exports
      • Config File
    • 💍Envi-Forever-Rings
      • Inventory Setup
      • Editable Functionality
      • Ring Shop MLO
      • Config File
    • 💻Envi-Hack-Minigames (Standalone)
      • The Worm
      • Password
      • Firewall
      • Node Runner
      • Config File
    • 🎞️Envi-HUD
      • ❗First Time Setup
      • Common Issues
      • Inventory Setup
      • Adding Custom Weapons
      • Change Logo
      • Custom Fonts
      • Converting Notifications
      • Converting Progress Bars
      • Editable Functionality
      • Settings Save Location
      • Exports and Events
      • Commands
      • Vehicle Control
      • Anti Muscle Spasm
      • Ragdoll
      • Config File
    • 🎇Envi-Items
      • Inventory Setup
      • Config File
    • 🚑Envi-Medic
      • Common Issues
      • Fully Disable Transport to Hospital
      • Failsafe
      • Ambulance Scripts
      • Vehicle Fuel
      • Vehicle Keys
      • Exports
      • Config File
    • ☄️Envi-MethVan
      • Common Issues
      • Inventory Setup
      • Cooking Process
      • Editable Functionality
      • Adding a Vehicle
      • Config File
    • 🍃Envi-Megablower9000 (Standalone)
      • Inventory Setup
      • Config File
    • 👯Envi-Population (Standalone)
      • ❗Initial Setup
      • Common Issues
      • Config File
    • 🗒️Envi-Prescriptions
      • Common Issues
      • Inventory Setup
      • Editable Functionality
      • Config File
    • 🔧Envi-Sabotage
      • ❗First Time Setup
      • Common Issues
      • Inventory Setup
      • Exports
    • 🛒Envi-Shops
      • Common Issues
      • Inventory Setup
      • Exports
      • Editable Functionality
      • Config File
    • 📱Envi-Trap-Phone
      • Common Issues
      • Inventory Setup
      • Commands
      • Exports
      • Adding Custom Drugs
      • Using the Phone
      • Disabling Extra Services
      • Config Files
        • config.lua
        • dialogueSettings.lua
        • extraServices.lua
        • gangZoneSettings.lua
        • personalitySettings.lua
        • specialContactSettings.lua
    • 👰Envi-Weddings
      • Inventory Setup
      • Starting Info
      • Manually Removing Data
      • Commands
      • Config File
    • 🎅Envi Xmas-Weapons (Standalone)
      • Inventory Setup
      • Config File
    • 🗡️Envi-Zombie-Weapons (Standalone)
      • Inventory Setup
    • 🧟‍♂️Envi-Zombies
Powered by GitBook
On this page
  • Envi-Trap-Phone Exports Documentation
  • Client Exports
  • Server Exports
  • Export Tables
  • Usage Examples
  1. Premium Scripts
  2. Envi-Trap-Phone

Exports

Envi-Trap-Phone Exports Documentation

Client Exports

Phone Status

  • Get the player's currently active phone ID:

local phoneId = exports['envi-trap-phone']:GetActivePhone()

Drug Sales Status

  • Check various sale states:

local isSelling = exports['envi-trap-phone']:isCornerSelling()
local isDropoffs = exports['envi-trap-phone']:isDoingDropOffs()
local isBusy = exports['envi-trap-phone']:isBusy()
  • Print the states:

print(isSelling, isDropoffs, isBusy)

Phone Communication

  • Send message from active phone:

exports['envi-trap-phone']:SendMessage("Meet me at the usual spot", "UNKNOWN") -- sender is optional

Contact Management

  • Add contact to active phone:

exports['envi-trap-phone']:AddContact({
    name = "Contact Name",
    number = "5551234",
    special = "regular", -- optional
    gang = nil -- optional
})
  • Force the player to level up and meet a new contact:

exports['envi-trap-phone']:MeetNewContact()

Ped Relationships

  • Update and check ped relationships:

local relationship = exports['envi-trap-phone']:GetPedRelationship(pedModel, faceValue)
exports['envi-trap-phone']:UpdatePedRelationship(pedModel, faceValue, amount)

Server Exports

Phone System

  • Send messages and manage contacts:

exports['envi-trap-phone']:SendMessageToPhone('5551234', '55543545', "Package ready")
  • Add contact to phone:

exports['envi-trap-phone']:AddContactToPhone('5551234', {
    name = "Big Mike",
    number = "55543545",
    special = "dealer",
    gang = "grove" -- optional
})
  • Get contact information:

  • contactData is a table of information

  • contactType is the type of contact such as "plug", "item_seller" or "regular"

local contactData, contactType = exports['envi-trap-phone']:GetContact(phoneId, contactNumber)
  • Get all contacts for a phone:

  • contacts is a table of all contacts

local contacts = exports['envi-trap-phone']:GetAllContacts(phoneId)
  • Verify phone ownership:

local isOwner = exports['envi-trap-phone']:VerifyPhoneOwnership(source, phoneId)

XP System

  • Add XP to weed:

exports['envi-trap-phone']:AddXP(source, phoneId, 'weed', 100)
  • Remove XP from weed:

exports['envi-trap-phone']:RemoveXP(source, phoneId, 'weed', 50)
  • Example of getting phone ID and adding XP:

local phoneId = exports['envi-trap-phone']:GetActivePhone()
exports['envi-trap-phone']:AddXP(source, phoneId, 'weed', 100)

Gang Reputation System

  • Increase your reputation with Ballas (Lowers the rank by 100 - Lower Rank = Higher Reputation):

exports['envi-trap-phone']:IncreaseGangRep(playerId, 'Ballas', 100)
  • Decrease your reputation with Ballas (Increases the rank by 50 - Lower Rank = Higher Reputation):

exports['envi-trap-phone']:DecreaseGangRep(playerId, 'Ballas', 50)

Job-Based Gang Reputation System

  • Increase job gang reputation:

exports['envi-trap-phone']:IncreaseJobGangRep(source, 'Ballas', 100, 'police')
  • Decrease job gang reputation:

exports['envi-trap-phone']:DecreaseJobGangRep(source, 'Ballas', 50, 'police')

Export Tables

Client Exports Guide

Export Name
Parameters
Returns
Description

Phone Functions

GetActivePhone

none

string/nil

Returns current active phone ID

SendMessage

message:string, sender:string?

boolean

Send message from active phone

AddContact

contactData:table

boolean

Add contact to active phone

MeetNewContact

none

boolean

Generate new contact meeting

Sale Status

isCornerSelling

none

boolean

Check if player is corner selling

isDoingDropOffs

none

boolean

Check if player is doing dropoffs

isBusy

none

boolean

Check if player is in active sale

Ped Relationships

UpdatePedRelationship

model:hash, face:number, amount:number

boolean

Update ped relationship

GetPedRelationship

model:hash, face:number

number

Get current relationship value

Job Gang Relationships

LoadGangData

none

nil

Load appropriate gang data

Server Exports Guide

Export Name
Parameters
Returns
Description

Phone System

SendMessageToPhone

from:string, to:string, content:string

boolean

Send message between phones

AddContactToPhone

phoneId:string, contactData:table

boolean

Add contact to phone

GetContact

phoneId:string, contactNumber:string

contact:table, type:string

Get specific contact

GetAllContacts

phoneId:string

contacts:table

Get all contacts for phone

VerifyPhoneOwnership

source:number, phoneId:string

boolean

Check phone ownership

XP System

AddXP

source:number, phoneId:string, drugKey:string, amount:number

boolean

Add drug XP

RemoveXP

source:number, phoneId:string, drugKey:string, amount:number

boolean

Remove drug XP

Personal Gang Reputation

IncreaseGangRep

source:number, gangName:string, amount:number

boolean

Increase gang reputation

DecreaseGangRep

source:number, gangName:string, amount:number

boolean

Decrease gang reputation

Job-Based Gang Reputation

IncreaseJobGangRep

source:number, gangName:string, amount:number, jobName:string

boolean

Increase job gang reputation

DecreaseJobGangRep

source:number, gangName:string, amount:number, jobName:string

boolean

Decrease job gang reputation

Usage Examples

Basic Phone Management

-- Client side - Check if player is selling and get phone
if exports['envi-trap-phone']:isCornerSelling() then
    local phoneId = exports['envi-trap-phone']:GetActivePhone()
    if phoneId then
        exports['envi-trap-phone']:SendMessage("Currently selling drugs", "System")
    end
end

Contact Management

-- Server side - Add a dealer contact to a phone
local success = exports['envi-trap-phone']:AddContactToPhone('5551234', {
    name = "Big Mike",
    number = "5559876",
    special = "dealer",
    gang = "grove"
})

-- Server side - Get contact information
local contact, contactType = exports['envi-trap-phone']:GetContact('5551234', '5559876')
if contact then
    print('Contact Name:', contact.name)
    print('Contact Type:', contactType)
end

Gang Reputation Management

-- Server side - Increase personal gang reputation
exports['envi-trap-phone']:IncreaseGangRep(source, 'Ballas', 100)

-- Server side - Increase job-based gang reputation for police
exports['envi-trap-phone']:IncreaseJobGangRep(source, 'Ballas', 100, 'police')

Job-Aware Gang System

-- Client side - Check if using job relationships and update accordingly
if exports['envi-trap-phone']:ShouldUseJobGangRelationships() then
    exports['envi-trap-phone']:UpdateJobAwareGangRank('Ballas', 50, function(success)
        if success then
            print('Job gang rank updated successfully')
        end
    end)
else
    -- Handle personal gang relationships
    print('Using personal gang relationships')
end

XP System Integration

-- Server side - Award XP after successful drug sale
local phoneId = exports['envi-trap-phone']:GetActivePhone() -- This would need to be called on client
if phoneId then
    local success = exports['envi-trap-phone']:AddXP(source, phoneId, 'weed', 25)
    if success then
        TriggerClientEvent('chat:addMessage', source, {
            args = {'System', 'You gained 25 weed XP!'}
        })
    end
end
PreviousCommandsNextAdding Custom Drugs

Last updated 1 day ago

📒
📱